summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlresolver.cpp16
-rw-r--r--src/urlbar/urlresolver.h7
2 files changed, 14 insertions, 9 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 71d6e69c..a7c63969 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -29,11 +29,9 @@
#include "urlresolver.moc"
// Local Includes
-#include "application.h"
#include "historymanager.h"
#include "bookmarkprovider.h"
#include "searchengine.h"
-#include "opensearchmanager.h"
// KDE Includes
#include <KBookmark>
@@ -72,7 +70,7 @@ UrlResolver::UrlResolver(const QString &typedUrl)
: QObject()
, _typedString(typedUrl.trimmed())
{
- if (!_searchEngine ) _searchEngine = SearchEngine::defaultEngine();
+ if (!_searchEngine ) setSearchEngine(SearchEngine::defaultEngine());
if ( _browseRegexp.isEmpty() )
{
@@ -392,25 +390,29 @@ void UrlResolver::computeSuggestions()
if (Application::opensearchManager()->isSuggestionAvailable())
{
connect(Application::opensearchManager(),
- SIGNAL(suggestionReceived(const QString &, const QStringList &)),
+ SIGNAL(suggestionReceived(const QString &, const ResponseList &)),
this,
- SLOT(suggestionsReceived(const QString &, const QStringList &)));
+ SLOT(suggestionsReceived(const QString &, const ResponseList &)));
Application::opensearchManager()->requestSuggestion(_typedString);
}
}
-void UrlResolver::suggestionsReceived(const QString &text, const QStringList &suggestions)
+void UrlResolver::suggestionsReceived(const QString &text, const ResponseList &suggestions)
{
if(text != _typedString)
return;
UrlSearchList sugList;
- Q_FOREACH(const QString &s, suggestions)
+ Q_FOREACH(const Response &i, suggestions)
{
+<<<<<<< HEAD
UrlSearchItem gItem(UrlSearchItem::Suggestion, SearchEngine::buildQuery(UrlResolver::searchEngine(), s), s);
+=======
+ UrlSearchItem gItem(UrlSearchItem::Suggestion, i.title, i.title);
+>>>>>>> add an xml parser to the opensearch engine.
sugList << gItem;
}
emit suggestionsReady(sugList, _typedString);
diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h
index f16c44f8..a94ef1de 100644
--- a/src/urlbar/urlresolver.h
+++ b/src/urlbar/urlresolver.h
@@ -30,6 +30,8 @@
// Rekonq Includes
#include "rekonq_defines.h"
+#include "application.h"
+#include "opensearchmanager.h"
// KDE Includes
#include <KUrl>
@@ -38,7 +40,7 @@
// Qt Includes
#include <QString>
#include <QList>
-#include <QStringList>
+#include "suggestionparser.h"
class UrlSearchItem
@@ -113,12 +115,13 @@ public:
static void setSearchEngine(KService::Ptr engine)
{
_searchEngine = engine;
+ Application::opensearchManager()->setSearchProvider(engine->desktopEntryName());
};
void computeSuggestions();
private Q_SLOTS:
- void suggestionsReceived(const QString &text, const QStringList &suggestions);
+ void suggestionsReceived(const QString &text, const ResponseList &suggestions);
Q_SIGNALS:
void suggestionsReady(const UrlSearchList &, const QString &);