summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-08-28 20:59:08 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-28 20:59:08 +0200
commit3f137d56176193c2bec7c876eb935612df91475c (patch)
tree69b1fe311e2e5781768f8a25db39a3e7d1a80a9b /src/search
parentIncrease xmlgui version number (just to be sure..) (diff)
downloadrekonq-3f137d56176193c2bec7c876eb935612df91475c.tar.xz
Restore urlbar responsiveness
Suggestions are now added when ready
Diffstat (limited to 'src/search')
-rw-r--r--src/search/opensearchmanager.cpp4
-rw-r--r--src/search/opensearchmanager.h8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/search/opensearchmanager.cpp b/src/search/opensearchmanager.cpp
index 463c0a11..2bb23121 100644
--- a/src/search/opensearchmanager.cpp
+++ b/src/search/opensearchmanager.cpp
@@ -134,6 +134,8 @@ void OpenSearchManager::requestSuggestion(const QString &searchText)
}
m_state = REQ_SUGGESTION;
+ _typedText = searchText;
+
KUrl url = m_activeEngine->suggestionsUrl(searchText);
kDebug() << "Requesting for suggestions: " << url.url();
m_jobData.clear();
@@ -161,7 +163,7 @@ void OpenSearchManager::jobFinished(KJob *job)
const QStringList suggestionsList = m_activeEngine->parseSuggestion(m_jobData);
kDebug() << "Received suggestion from " << m_activeEngine->name() << ": " << suggestionsList;
- emit suggestionReceived(suggestionsList);
+ emit suggestionReceived(_typedText, suggestionsList);
return;
}
diff --git a/src/search/opensearchmanager.h b/src/search/opensearchmanager.h
index 8a45b83c..8a234df2 100644
--- a/src/search/opensearchmanager.h
+++ b/src/search/opensearchmanager.h
@@ -82,17 +82,17 @@ public:
public slots:
/**
* Ask the specific suggestion engine to request for suggestion for the search text
- * @param searchProvider the search provider that provides the suggestion service
+ *
* @param searchText the text to be queried to the suggestion service
*/
- void requestSuggestion(const QString &searchProvider);
+ void requestSuggestion(const QString &searchText);
private slots:
void dataReceived(KIO::Job *job, const QByteArray &data);
void jobFinished(KJob *job);
signals:
- void suggestionReceived(const QStringList &suggestion);
+ void suggestionReceived(const QString &text, const QStringList &suggestion);
void openSearchEngineAdded(const QString &name, const QString &searchUrl, const QString &fileName);
private:
@@ -103,6 +103,8 @@ private:
QMap<QString, OpenSearchEngine*> m_enginesMap;
OpenSearchEngine *m_activeEngine;
STATE m_state;
+
+ QString _typedText;
};
#endif // OPENSEARCHMANAGER_H