mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Always connect model and view before loading a playlist so the spinner appears.
This commit is contained in:
@@ -110,9 +110,10 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
|||||||
|
|
||||||
connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
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() );
|
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
|
else
|
||||||
qDebug() << "Playlist seems empty:" << playlist->title();
|
qDebug() << "Playlist seems empty:" << playlist->title();
|
||||||
|
|
||||||
if( !m_waitingForResolved.isEmpty() )
|
if ( !m_waitingForResolved.isEmpty() )
|
||||||
|
{
|
||||||
emit loadingStarted();
|
emit loadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
emit trackCountChanged( rowCount( QModelIndex() ) );
|
emit trackCountChanged( rowCount( QModelIndex() ) );
|
||||||
}
|
}
|
||||||
@@ -230,8 +233,10 @@ PlaylistModel::trackResolved( bool )
|
|||||||
m_waitingForResolved.removeAll( q );
|
m_waitingForResolved.removeAll( q );
|
||||||
disconnect( q, SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolved( bool ) ) );
|
disconnect( q, SIGNAL( resolvingFinished( bool ) ), this, SLOT( trackResolved( bool ) ) );
|
||||||
|
|
||||||
if( m_waitingForResolved.isEmpty() )
|
if ( m_waitingForResolved.isEmpty() )
|
||||||
|
{
|
||||||
emit loadingFinished();
|
emit loadingFinished();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -152,14 +152,14 @@ ViewManager::queue() const
|
|||||||
return m_queueView->queue();
|
return m_queueView->queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PlaylistView*
|
PlaylistView*
|
||||||
ViewManager::createPageForPlaylist( const playlist_ptr& pl )
|
ViewManager::createPageForPlaylist( const playlist_ptr& pl )
|
||||||
{
|
{
|
||||||
PlaylistView* view = new PlaylistView();
|
PlaylistView* view = new PlaylistView();
|
||||||
|
|
||||||
PlaylistModel* model = new PlaylistModel();
|
PlaylistModel* model = new PlaylistModel();
|
||||||
model->loadPlaylist( pl );
|
|
||||||
view->setPlaylistModel( model );
|
view->setPlaylistModel( model );
|
||||||
|
model->loadPlaylist( pl );
|
||||||
view->setFrameShape( QFrame::NoFrame );
|
view->setFrameShape( QFrame::NoFrame );
|
||||||
view->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
view->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
pl->resolve();
|
pl->resolve();
|
||||||
|
Reference in New Issue
Block a user