]> git.sesse.net Git - vlc/commitdiff
qt4: gotoPLayingItem get's current index from model, not from view
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 15:05:57 +0000 (18:05 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 15:06:12 +0000 (18:06 +0300)
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/standardpanel.cpp

index cdac23246e442640630444df8c8380de7c46587d..41d93fd6e13bbc45eb4e39b9b554180810f72754 100644 (file)
@@ -97,6 +97,7 @@ public:
                          int role = Qt::DisplayRole ) const;
     QModelIndex index( int r, int c, const QModelIndex &parent ) const;
     QModelIndex index( PLItem *, int c ) const;
+    QModelIndex currentIndex( ) { return index( currentItem, 0 ); };
     int itemId( const QModelIndex &index ) const;
     bool isCurrent( const QModelIndex &index ) const;
     QModelIndex parent( const QModelIndex &index ) const;
index 8c1cef8d0d9478de7aae2b7b04c956514afbe354..a12158f9f41abfa4e6d633ad75f0bc4661d30083 100644 (file)
@@ -206,7 +206,7 @@ void StandardPLPanel::toggleRandom()
 
 void StandardPLPanel::gotoPlayingItem()
 {
-    view->scrollTo( view->currentIndex() );
+    view->scrollTo( model->currentIndex() );
 }
 
 void StandardPLPanel::handleExpansion( const QModelIndex& index )