1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* PlayableModel::ensureResolved() now traverses through parent nodes.

This commit is contained in:
Christian Muehlhaeuser
2014-10-06 08:55:51 +02:00
parent 86438e530e
commit 4826492c8f
2 changed files with 8 additions and 4 deletions

View File

@@ -840,12 +840,16 @@ PlayableModel::onPlaybackStopped()
void void
PlayableModel::ensureResolved() PlayableModel::ensureResolved( const QModelIndex& parent )
{ {
QList< query_ptr > ql; QList< query_ptr > ql;
for ( int i = 0; i < rowCount( QModelIndex() ); i++ ) for ( int i = 0; i < rowCount( parent ); i++ )
{ {
query_ptr query = itemFromIndex( index( i, 0, QModelIndex() ) )->query(); const QModelIndex idx = index( i, 0, parent );
if ( hasChildren( idx ) )
ensureResolved( idx );
query_ptr query = itemFromIndex( idx )->query();
if ( !query ) if ( !query )
continue; continue;

View File

@@ -119,7 +119,7 @@ public:
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const; virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const;
virtual bool shuffled() const { return false; } virtual bool shuffled() const { return false; }
virtual void ensureResolved(); virtual void ensureResolved( const QModelIndex& parent = QModelIndex() );
virtual PlayableItem* itemFromIndex( const QModelIndex& index ) const; virtual PlayableItem* itemFromIndex( const QModelIndex& index ) const;
virtual PlayableItem* itemFromQuery( const Tomahawk::query_ptr& query ) const; virtual PlayableItem* itemFromQuery( const Tomahawk::query_ptr& query ) const;