1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 14:46:33 +02:00

Try fixing chart loading race condition

This commit is contained in:
Leo Franchi
2011-10-27 23:49:56 -04:00
parent 4de60911cd
commit b040870cf1
2 changed files with 10 additions and 3 deletions

View File

@@ -238,7 +238,8 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
m_artistModels[ chartId ] = artistsModel; m_artistModels[ chartId ] = artistsModel;
setLeftViewArtists( artistsModel ); if ( m_queueItemToShow == chartId )
setLeftViewArtists( artistsModel );
} }
else if( type == "albums" ) else if( type == "albums" )
{ {
@@ -259,7 +260,9 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
albumModel->addAlbums( al ); albumModel->addAlbums( al );
m_albumModels[ chartId ] = albumModel; m_albumModels[ chartId ] = albumModel;
setLeftViewAlbums( albumModel );
if ( m_queueItemToShow == chartId )
setLeftViewAlbums( albumModel );
} }
else if( type == "tracks" ) else if( type == "tracks" )
{ {
@@ -278,7 +281,9 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
trackModel->append( tracklist ); trackModel->append( tracklist );
m_trackModels[ chartId ] = trackModel; m_trackModels[ chartId ] = trackModel;
setLeftViewTracks( trackModel );
if ( m_queueItemToShow == chartId )
setLeftViewTracks( trackModel );
} }
else else
{ {
@@ -360,6 +365,7 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 20000, true ); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 20000, true );
m_queuedFetches.insert( chartId ); m_queuedFetches.insert( chartId );
m_queueItemToShow = chartId;
} }

View File

@@ -96,6 +96,7 @@ private:
QHash< QString, AlbumModel* > m_albumModels; QHash< QString, AlbumModel* > m_albumModels;
QHash< QString, TreeModel* > m_artistModels; QHash< QString, TreeModel* > m_artistModels;
QHash< QString, PlaylistModel* > m_trackModels; QHash< QString, PlaylistModel* > m_trackModels;
QString m_queueItemToShow;
QSet< QString > m_queuedFetches; QSet< QString > m_queuedFetches;
QTimer* m_timer; QTimer* m_timer;
}; };