summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-04-28 12:22:33 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-04-28 12:22:33 +0200
commitef1c018dd888c1aefa134c38d74ad8a2c69a561c (patch)
tree0ad35fc32bc2d4e9c10808dd96559cac220c571c /src
parentRevert "Use kurifilter instead of custom rekonq code." (diff)
downloadrekonq-ef1c018dd888c1aefa134c38d74ad8a2c69a561c.tar.xz
clean up search url detection the rekonq way
Diffstat (limited to 'src')
-rw-r--r--src/searchengine.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/searchengine.cpp b/src/searchengine.cpp
index cfe84a69..dd01f703 100644
--- a/src/searchengine.cpp
+++ b/src/searchengine.cpp
@@ -31,6 +31,7 @@
//KDE includes
#include <KConfigGroup>
#include <KServiceTypeTrader>
+#include <KUriFilter>
#include <QStringList>
@@ -153,7 +154,13 @@ QString SearchEngine::buildQuery(KService::Ptr engine, const QString &text)
{
if (!engine)
return QString();
- QString query = engine->property("Query").toString();
- query = query.replace("\\{@}", KUrl::toPercentEncoding(text));
+
+ QString shortcut = engine->property("Keys").toStringList().at(0);
+ QString query = shortcut + delimiter() + text;
+
+ QStringList filters;
+ filters << QL1S("kurisearchfilter");
+ KUriFilter::self()->filterUri(query, filters);
+
return query;
}