diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp index a18f63f37..1614e33d7 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.cpp @@ -72,6 +72,12 @@ EchonestFactory::typeSelectors() const CatalogManager::CatalogManager( QObject* parent ) : QObject( parent ) +{ + connect( SourceList::instance(), SIGNAL( ready() ), this, SLOT( init() ) ); +} + +void +CatalogManager::init() { connect( EchonestCatalogSynchronizer::instance(), SIGNAL( knownCatalogsChanged() ), this, SLOT( doCatalogUpdate() ) ); connect( SourceList::instance(), SIGNAL( ready() ), this, SLOT( doCatalogUpdate() ) ); diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h index a19acc1ca..7fed85cce 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h @@ -46,6 +46,7 @@ signals: void catalogsUpdated(); private slots: + void init(); void doCatalogUpdate(); void collectionAttributes( const PairList& ); diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index fecbe5272..2d90e75f1 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -181,7 +181,7 @@ TomahawkApp::init() new Pipeline( this ); m_servent = QWeakPointer( new Servent( this ) ); - connect( m_servent.data(), SIGNAL( ready() ), SLOT( serventReady() ) ); + connect( m_servent.data(), SIGNAL( ready() ), SLOT( initSIP() ) ); tDebug() << "Init Database."; initDatabase(); @@ -219,6 +219,8 @@ TomahawkApp::init() Echonest::Config::instance()->setAPIKey( "JRIHWEP6GPOER2QQ6" ); Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() ); + EchonestGenerator::setupCatalogs(); + #ifndef TOMAHAWK_HEADLESS if ( !m_headless ) { @@ -499,14 +501,6 @@ TomahawkApp::initServent() } } -void -TomahawkApp::serventReady() -{ - EchonestGenerator::setupCatalogs(); - - initSIP(); -} - void TomahawkApp::initSIP() { diff --git a/src/tomahawkapp.h b/src/tomahawkapp.h index 7a8a906cd..769c8caad 100644 --- a/src/tomahawkapp.h +++ b/src/tomahawkapp.h @@ -95,12 +95,11 @@ public slots: private slots: void initServent(); - void serventReady(); + void initSIP(); void spotifyApiCheckFinished(); private: - void initSIP(); void registerMetaTypes(); void printHelp();