1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +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,6 +238,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
m_artistModels[ chartId ] = artistsModel; m_artistModels[ chartId ] = artistsModel;
if ( m_queueItemToShow == chartId )
setLeftViewArtists( artistsModel ); setLeftViewArtists( artistsModel );
} }
else if( type == "albums" ) else if( type == "albums" )
@@ -259,6 +260,8 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
albumModel->addAlbums( al ); albumModel->addAlbums( al );
m_albumModels[ chartId ] = albumModel; m_albumModels[ chartId ] = albumModel;
if ( m_queueItemToShow == chartId )
setLeftViewAlbums( albumModel ); setLeftViewAlbums( albumModel );
} }
else if( type == "tracks" ) else if( type == "tracks" )
@@ -278,6 +281,8 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
trackModel->append( tracklist ); trackModel->append( tracklist );
m_trackModels[ chartId ] = trackModel; m_trackModels[ chartId ] = trackModel;
if ( m_queueItemToShow == chartId )
setLeftViewTracks( trackModel ); 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;
}; };