┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2015-02-26 17:40:06 +0100
committerEmmanuel Pescosta <[email protected]>2015-02-26 18:10:42 +0100
commit832e157ecd1a1640b82425358b20fff416a2f8b7 (patch)
treef7bd0c344151fe3ef6354ae410f9b45b3b7e0a10 /src/search
parent41424d010934e0a47958d0192c7c4de69ea3e955 (diff)
Port away from KDELibs4Support (we only use KDELibs4Support when baloo isn't present, because KFileMetaDataWidget is in KDELibs4Support)
Reviewed-By: Vishesh Handa
Diffstat (limited to 'src/search')
-rw-r--r--src/search/dolphinsearchbox.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp
index d4ebba8c0..524c4462f 100644
--- a/src/search/dolphinsearchbox.cpp
+++ b/src/search/dolphinsearchbox.cpp
@@ -37,6 +37,7 @@
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>
+#include <QUrlQuery>
#include <config-baloo.h>
#ifdef HAVE_BALOO
@@ -130,9 +131,11 @@ QUrl DolphinSearchBox::urlForSearching() const
url = balooUrlForSearching();
} else {
url.setScheme("filenamesearch");
- url.addQueryItem("search", m_searchInput->text());
+
+ QUrlQuery query;
+ query.addQueryItem("search", m_searchInput->text());
if (m_contentButton->isChecked()) {
- url.addQueryItem("checkContent", "yes");
+ query.addQueryItem("checkContent", "yes");
}
QString encodedUrl;
@@ -144,7 +147,9 @@ QUrl DolphinSearchBox::urlForSearching() const
} else {
encodedUrl = m_searchPath.url();
}
- url.addQueryItem("url", encodedUrl);
+ query.addQueryItem("url", encodedUrl);
+
+ url.setQuery(query);
}
return url;
@@ -155,9 +160,10 @@ void DolphinSearchBox::fromSearchUrl(const QUrl& url)
if (url.scheme() == "baloosearch") {
fromBalooSearchUrl(url);
} else if (url.scheme() == "filenamesearch") {
- setText(url.queryItemValue("search"));
- setSearchPath(QUrl::fromUserInput(url.queryItemValue("url"), QString(), QUrl::AssumeLocalFile));
- m_contentButton->setChecked(url.queryItemValue("checkContent") == "yes");
+ const QUrlQuery query(url);
+ setText(query.queryItemValue("search"));
+ setSearchPath(QUrl::fromUserInput(query.queryItemValue("url"), QString(), QUrl::AssumeLocalFile));
+ m_contentButton->setChecked(query.queryItemValue("checkContent") == "yes");
} else {
setText(QString());
setSearchPath(url);