1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 00:42:04 +02:00

Also allow multiple infoplugins to return data for artist top tracks

This commit is contained in:
Leo Franchi 2012-07-13 23:19:21 -04:00
parent 14df0aef4a
commit b39dbe6880
2 changed files with 19 additions and 0 deletions

@ -112,6 +112,10 @@ ArtistPlaylistInterface::tracks()
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( finished( QString ) ),
SLOT( infoSystemFinished( QString ) ) );
}
else if ( m_mode == DatabaseMode && !m_databaseLoaded )
{
@ -176,9 +180,23 @@ ArtistPlaylistInterface::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData r
}
}
if ( !m_queries.isEmpty() )
infoSystemFinished( id() );
}
void
ArtistPlaylistInterface::infoSystemFinished( const QString &infoId )
{
if ( infoId != id() )
return;
m_infoSystemLoaded = true;
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
this, SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ),
this, SLOT( infoSystemFinished( QString) ) );
if ( m_queries.isEmpty() && m_mode == Mixed )
{

@ -60,6 +60,7 @@ signals:
private slots:
void onTracksLoaded( const QList< Tomahawk::query_ptr >& tracks );
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void infoSystemFinished( const QString& infoId );
private:
Q_DISABLE_COPY( ArtistPlaylistInterface )