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

Let AlbumPlaylistInterface accept results from first good infoplugin result

This commit is contained in:
Leo Franchi
2012-07-13 17:47:13 -04:00
committed by Christian Muehlhaeuser
parent 56e997a159
commit c33d3c2a67
2 changed files with 20 additions and 0 deletions

View File

@@ -114,6 +114,10 @@ AlbumPlaylistInterface::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 )
{
@@ -178,9 +182,24 @@ AlbumPlaylistInterface::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData re
}
}
if ( !m_queries.isEmpty() )
{
infoSystemFinished( id() );
}
}
void
AlbumPlaylistInterface::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 )
{

View File

@@ -64,6 +64,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:
QList< Tomahawk::query_ptr > m_queries;