diff --git a/src/libtomahawk/playlist/playlistmodel.cpp b/src/libtomahawk/playlist/playlistmodel.cpp index fc1f27214..7048e49ff 100644 --- a/src/libtomahawk/playlist/playlistmodel.cpp +++ b/src/libtomahawk/playlist/playlistmodel.cpp @@ -110,9 +110,10 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) ); - if( !entry->query()->resolvingFinished() && !entry->query()->playable() ) { + if ( !entry->query()->resolvingFinished() && !entry->query()->playable() ) + { m_waitingForResolved.append( entry->query().data() ); - connect( entry->query().data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolved( bool ) ) ); + connect( entry->query().data(), SIGNAL( resolvingFinished( bool ) ), SLOT( trackResolved( bool ) ) ); } } @@ -121,8 +122,10 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn else qDebug() << "Playlist seems empty:" << playlist->title(); - if( !m_waitingForResolved.isEmpty() ) + if ( !m_waitingForResolved.isEmpty() ) + { emit loadingStarted(); + } emit trackCountChanged( rowCount( QModelIndex() ) ); } @@ -230,8 +233,10 @@ PlaylistModel::trackResolved( bool ) m_waitingForResolved.removeAll( q ); disconnect( q, SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolved( bool ) ) ); - if( m_waitingForResolved.isEmpty() ) + if ( m_waitingForResolved.isEmpty() ) + { emit loadingFinished(); + } } diff --git a/src/libtomahawk/viewmanager.cpp b/src/libtomahawk/viewmanager.cpp index b6b610ec6..efb2ca5ad 100644 --- a/src/libtomahawk/viewmanager.cpp +++ b/src/libtomahawk/viewmanager.cpp @@ -152,14 +152,14 @@ ViewManager::queue() const return m_queueView->queue(); } + PlaylistView* ViewManager::createPageForPlaylist( const playlist_ptr& pl ) { PlaylistView* view = new PlaylistView(); - PlaylistModel* model = new PlaylistModel(); - model->loadPlaylist( pl ); view->setPlaylistModel( model ); + model->loadPlaylist( pl ); view->setFrameShape( QFrame::NoFrame ); view->setAttribute( Qt::WA_MacShowFocusRect, 0 ); pl->resolve();