[vlc-devel] commit: Qt: add public index-from-id function to PLModel (Jakob Leben )
git version control
git at videolan.org
Thu Jan 28 03:13:44 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Thu Jan 28 03:10:13 2010 +0100| [03fef5e5f807411e3e2ebb9e4364edafa57a9b1a] | committer: Jakob Leben
Qt: add public index-from-id function to PLModel
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03fef5e5f807411e3e2ebb9e4364edafa57a9b1a
---
.../gui/qt4/components/playlist/playlist_model.cpp | 5 +++++
.../gui/qt4/components/playlist/playlist_model.hpp | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 98c40f7..eceba07 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -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
{
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 64ecae5..c8cb8f0 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -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;
More information about the vlc-devel
mailing list