diff --git a/src/globalsearch/globalsearch.cpp b/src/globalsearch/globalsearch.cpp index 59a4743ea..7cb672149 100644 --- a/src/globalsearch/globalsearch.cpp +++ b/src/globalsearch/globalsearch.cpp @@ -44,6 +44,8 @@ GlobalSearch::GlobalSearch(Application* app, QObject* parent) connect(app_->album_cover_loader(), SIGNAL(ImageLoaded(quint64, QImage)), SLOT(AlbumArtLoaded(quint64, QImage))); + connect(this, SIGNAL(SearchAsyncSig(int,QString)), + this, SLOT(DoSearchAsync(int,QString))); ConnectProvider(url_provider_); } @@ -82,6 +84,13 @@ void GlobalSearch::AddProvider(SearchProvider* provider) { int GlobalSearch::SearchAsync(const QString& query) { const int id = next_id_++; + + emit SearchAsyncSig(id, query); + + return id; +} + +void GlobalSearch::DoSearchAsync(int id, const QString& query) { pending_search_providers_[id] = 0; int timer_id = -1; @@ -106,8 +115,6 @@ int GlobalSearch::SearchAsync(const QString& query) { } } } - - return id; } void GlobalSearch::CancelSearch(int id) { diff --git a/src/globalsearch/globalsearch.h b/src/globalsearch/globalsearch.h index 3004569b8..4d7a8f54f 100644 --- a/src/globalsearch/globalsearch.h +++ b/src/globalsearch/globalsearch.h @@ -62,9 +62,11 @@ class GlobalSearch : public QObject { bool is_provider_usable(SearchProvider* provider) const; public slots: + void ReloadSettings(); signals: + void SearchAsyncSig(int id, const QString& query); void ResultsAvailable(int id, const SearchProvider::ResultList& results); void ProviderSearchFinished(int id, const SearchProvider* provider); void SearchFinished(int id); @@ -79,6 +81,7 @@ signals: void timerEvent(QTimerEvent* e); private slots: + void DoSearchAsync(int id, const QString& query); void ResultsAvailableSlot(int id, SearchProvider::ResultList results); void SearchFinishedSlot(int id);