Commit 76cc0af9 authored by Jakob Leben's avatar Jakob Leben

Qt: make PLModel::getItem return rootItem as well, add id getter to PLItem

parent 6a5e8468
......@@ -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;
......
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment