[vlc-devel] commit: Qt: make PLModel::getItem return rootItem as well, add id getter to PLItem (Jakob Leben )
git version control
git at videolan.org
Thu Jan 28 06:54:18 CET 2010
vlc | branch: master | Jakob Leben <jleben at videolan.org> | Thu Jan 28 06:50:35 2010 +0100| [76cc0af99edbc20c30977006b677614370af726b] | committer: Jakob Leben
Qt: make PLModel::getItem return rootItem as well, add id getter to PLItem
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=76cc0af99edbc20c30977006b677614370af726b
---
.../gui/qt4/components/playlist/playlist_item.hpp | 1 +
.../gui/qt4/components/playlist/playlist_model.cpp | 6 ------
.../gui/qt4/components/playlist/playlist_model.hpp | 7 ++++++-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_item.hpp b/modules/gui/qt4/components/playlist/playlist_item.hpp
index ab05a15..45f8d8c 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.hpp
@@ -55,6 +55,7 @@ public:
PLItem *parent() { return parentItem; }
input_item_t *inputItem() { return p_input; }
+ int id() { return i_id; }
protected:
QList<PLItem*> children;
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index eceba07..a9bef58 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -529,12 +529,6 @@ PLItem * PLModel::findInner( PLItem *root, int i_id, bool b_input )
#undef CACHE
#undef ICACHE
-PLItem *PLModel::getItem( QModelIndex index )
-{
- assert( index.isValid() );
- return static_cast<PLItem*>( index.internalPointer() );
-}
-
int PLModel::columnToMeta( int _column ) const
{
int meta = 1;
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index c8cb8f0..cd5b1ec 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -96,7 +96,12 @@ public:
void removeItem( int );
void rebuild(); void rebuild( playlist_item_t *, bool b_first = false );
- static inline PLItem *getItem( QModelIndex index );
+ inline PLItem *getItem( QModelIndex index ) const
+ {
+ if( index.isValid() )
+ return static_cast<PLItem*>( index.internalPointer() );
+ else return rootItem;
+ }
private:
More information about the vlc-devel
mailing list