1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01: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
src/libtomahawk/playlist

@ -840,12 +840,16 @@ PlayableModel::onPlaybackStopped()
void
PlayableModel::ensureResolved()
PlayableModel::ensureResolved( const QModelIndex& parent )
{
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 )
continue;

@ -119,7 +119,7 @@ public:
virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const;
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* itemFromQuery( const Tomahawk::query_ptr& query ) const;