diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp index 0a8919ac9..4d66f45f3 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.cpp @@ -29,6 +29,7 @@ #include #include +QHash< QString, QStringList > Tomahawk::EchonestControl::s_suggestCache = QHash< QString, QStringList >(); Tomahawk::EchonestControl::EchonestControl( const QString& selectedType, const QStringList& typeSelectors, QObject* parent ) : DynamicControl ( selectedType.isEmpty() ? "Artist" : selectedType, typeSelectors, parent ) @@ -572,8 +573,8 @@ Tomahawk::EchonestControl::artistTextEdited( const QString& text ) m_suggestWorkers.clear(); if( !text.isEmpty() ) { - if( m_suggestCache.contains( text ) ) { - addArtistSuggestions( m_suggestCache[ text ] ); + if( s_suggestCache.contains( text ) ) { + addArtistSuggestions( s_suggestCache[ text ] ); } else { // gotta look it up QNetworkReply* r = Echonest::Artist::suggest( text ); qDebug() << "Asking echonest for suggestions to help our completion..." << r->url().toString(); @@ -615,7 +616,7 @@ Tomahawk::EchonestControl::suggestFinished() return; } - m_suggestCache[ origText ] = suggestions; + s_suggestCache[ origText ] = suggestions; addArtistSuggestions( suggestions ); } diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h index c8f448319..d1e8159cc 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h @@ -91,7 +91,7 @@ private: QVariant m_cacheData; QSet< QNetworkReply* > m_suggestWorkers; - QHash< QString, QStringList > m_suggestCache; + static QHash< QString, QStringList > s_suggestCache; friend class EchonestGenerator; };