From 27d20e03952a88a2f06868654ad478b144a5d6bf Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 26 Sep 2014 05:38:00 +0200 Subject: [PATCH] * React to more view changes in GridView, making sure we display covers of visible items. --- src/libtomahawk/playlist/GridView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libtomahawk/playlist/GridView.cpp b/src/libtomahawk/playlist/GridView.cpp index 0a85a0645..0792461c6 100644 --- a/src/libtomahawk/playlist/GridView.cpp +++ b/src/libtomahawk/playlist/GridView.cpp @@ -112,12 +112,14 @@ GridView::setProxyModel( PlayableProxyModel* model ) disconnect( m_proxyModel, SIGNAL( filterChanged( QString ) ), this, SLOT( onFilterChanged( QString ) ) ); disconnect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( verifySize() ) ); disconnect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( verifySize() ) ); + disconnect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( onViewChanged() ) ); disconnect( m_proxyModel, SIGNAL( modelReset() ), this, SLOT( layoutItems() ) ); } m_proxyModel = model; connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) ); connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( verifySize() ), Qt::QueuedConnection ); + connect( m_proxyModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), SLOT( onViewChanged() ), Qt::QueuedConnection ); connect( m_proxyModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), SLOT( verifySize() ), Qt::QueuedConnection ); connect( m_proxyModel, SIGNAL( modelReset() ), SLOT( layoutItems() ), Qt::QueuedConnection ); @@ -362,6 +364,8 @@ GridView::onFilterChanged( const QString& ) { if ( selectedIndexes().count() ) scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter ); + + onViewChanged(); }