]> git.sesse.net Git - vlc/commitdiff
Qt: add public index-from-id function to PLModel
authorJakob Leben <jleben@videolan.org>
Thu, 28 Jan 2010 02:10:13 +0000 (03:10 +0100)
committerJakob Leben <jleben@videolan.org>
Thu, 28 Jan 2010 02:13:29 +0000 (03:13 +0100)
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp

index 98c40f7fe0de0f560b2e1301337352bef1f0bc11..eceba07114568bd2889b2d01941917c53e6ea505 100644 (file)
@@ -385,6 +385,11 @@ QModelIndex PLModel::index( int row, int column, const QModelIndex &parent )
         return QModelIndex();
 }
 
+QModelIndex PLModel::index( int i_id, int c )
+{
+  return index( findById( rootItem, i_id ), c );
+}
+
 /* Return the index of a given item */
 QModelIndex PLModel::index( PLItem *item, int column ) const
 {
index 64ecae5e960fe6527a90e4d767e1fc904ea5bb2a..c8cb8f03936b210cfdc1e0d0c910d914265304d1 100644 (file)
@@ -82,6 +82,7 @@ public:
     /* Lookups */
     QStringList selectedURIs();
     QModelIndex index( PLItem *, int c ) const;
+    QModelIndex index( int i_id, int c );
     QModelIndex currentIndex( ) { return index( currentItem, 0 ); };
     bool isCurrent( const QModelIndex &index ) const;
     int itemId( const QModelIndex &index ) const;