]> git.sesse.net Git - vlc/commitdiff
QT4: connect currentChanged from model on iconView case also
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 26 Jan 2010 20:50:55 +0000 (22:50 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 26 Jan 2010 20:51:49 +0000 (22:51 +0200)
Should fix issue on not scrolling to current item when it changes in iconView

modules/gui/qt4/components/playlist/standardpanel.cpp

index 14ee07f24f3c070204a476dcbaa8a9de4871a805..840ce2f433171921226dd80486e5059be3ea548b 100644 (file)
@@ -130,8 +130,7 @@ void StandardPLPanel::gotoPlayingItem()
 
 void StandardPLPanel::handleExpansion( const QModelIndex& index )
 {
-    assert( treeView );
-    treeView->scrollTo( index );
+    currentView->scrollTo( index );
 }
 
 /* PopupAdd Menu for the Add Menu */
@@ -319,8 +318,6 @@ void StandardPLPanel::createTreeView()
              this, popupSelectColumn( QPoint ) );
     CONNECT( treeView, customContextMenuRequested( const QPoint & ),
              this, popupPlView( const QPoint & ) );
-    CONNECT( model, currentChanged( const QModelIndex& ),
-             this, handleExpansion( const QModelIndex& ) );
 
     /* SignalMapper for columns */
     selectColumnsSigMapper = new QSignalMapper( this );
@@ -351,6 +348,8 @@ void StandardPLPanel::toggleView()
         treeView->show();
         currentView = treeView;
     }
+    CONNECT( model, currentChanged( const QModelIndex& ),
+             this, handleExpansion( const QModelIndex& ) );
 }
 
 void StandardPLPanel::wheelEvent( QWheelEvent *e )