1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

* Always connect model and view before loading a playlist so the spinner appears.

This commit is contained in:
Christian Muehlhaeuser 2011-05-20 03:40:28 +02:00
parent c07ab346f4
commit 303c32ba6f
2 changed files with 11 additions and 6 deletions

View File

@ -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();
}
}

View File

@ -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();