summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-09-02 10:32:09 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-09-02 10:32:09 +0200
commitad83718d864898600356031acc39ebfe403eeaad (patch)
treee9b9be2a72aadbca1fba96ab4406b660f66b240c /src/search
parentfix memory leak when delete current job in opensearchmanager (diff)
parentbig commit: fix fast typing (diff)
downloadrekonq-ad83718d864898600356031acc39ebfe403eeaad.tar.xz
Merge commit 'refs/merge-requests/195' of git://gitorious.org/rekonq/mainline into m195
Diffstat (limited to 'src/search')
-rw-r--r--src/search/searchengine.cpp13
-rw-r--r--src/search/searchengine.h3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/search/searchengine.cpp b/src/search/searchengine.cpp
index 38f063a4..8eecfa52 100644
--- a/src/search/searchengine.cpp
+++ b/src/search/searchengine.cpp
@@ -136,6 +136,19 @@ KService::Ptr SearchEngine::fromString(QString text)
}
+QString SearchEngine::extractQuery(QString text)
+{
+ QString query = text;
+ KService::Ptr engine = SearchEngine::fromString(text);
+ if (engine)
+ {
+ query = query.remove(0, text.indexOf(SearchEngine::delimiter()) + 1);
+ }
+
+ return query;
+}
+
+
QString SearchEngine::buildQuery(KService::Ptr engine, QString text)
{
QString query = engine->property("Query").toString();
diff --git a/src/search/searchengine.h b/src/search/searchengine.h
index e57b1a5c..aa7d7a8b 100644
--- a/src/search/searchengine.h
+++ b/src/search/searchengine.h
@@ -47,7 +47,8 @@ public:
static KService::List favorites();
static KService::Ptr fromString(QString text);
static QString buildQuery(KService::Ptr engine, QString text);
-
+ static QString extractQuery(QString text);
+
private:
static bool m_loaded;
static QString m_delimiter;