From 4e3febcb5b01e39ad27f02cd2193cffa1352a252 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 13 Jul 2012 17:47:13 -0400 Subject: [PATCH] Let AlbumPlaylistInterface accept results from first good infoplugin result --- src/libtomahawk/AlbumPlaylistInterface.cpp | 19 +++++++++++++++++++ src/libtomahawk/AlbumPlaylistInterface.h | 1 + 2 files changed, 20 insertions(+) diff --git a/src/libtomahawk/AlbumPlaylistInterface.cpp b/src/libtomahawk/AlbumPlaylistInterface.cpp index d74af3811..050fcea81 100644 --- a/src/libtomahawk/AlbumPlaylistInterface.cpp +++ b/src/libtomahawk/AlbumPlaylistInterface.cpp @@ -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 ) { diff --git a/src/libtomahawk/AlbumPlaylistInterface.h b/src/libtomahawk/AlbumPlaylistInterface.h index b2c9d471c..f5f005c83 100644 --- a/src/libtomahawk/AlbumPlaylistInterface.h +++ b/src/libtomahawk/AlbumPlaylistInterface.h @@ -61,6 +61,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;