[vlc-devel] commit: qt4: gotoPLayingItem get's current index from model, not from view (Ilkka Ollakka )

git version control git at videolan.org
Tue Aug 18 17:07:14 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue Aug 18 18:05:57 2009 +0300| [c4e943d76998ea1487c21e4ce03059e14c84c973] | committer: Ilkka Ollakka 

qt4: gotoPLayingItem get's current index from model, not from view

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4e943d76998ea1487c21e4ce03059e14c84c973
---

 .../gui/qt4/components/playlist/playlist_model.hpp |    1 +
 .../gui/qt4/components/playlist/standardpanel.cpp  |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index cdac232..41d93fd 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -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;
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 8c1cef8..a12158f 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -206,7 +206,7 @@ void StandardPLPanel::toggleRandom()
 
 void StandardPLPanel::gotoPlayingItem()
 {
-    view->scrollTo( view->currentIndex() );
+    view->scrollTo( model->currentIndex() );
 }
 
 void StandardPLPanel::handleExpansion( const QModelIndex& index )




More information about the vlc-devel mailing list