┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/dolphinfacetswidget.cpp
diff options
context:
space:
mode:
authorIsmael Asensio <[email protected]>2020-01-09 00:39:28 +0100
committerIsmael Asensio <[email protected]>2020-01-19 23:17:26 +0100
commit5778099ece7a4e6c37c3e0c6950aa0bdf259bcb3 (patch)
tree7937371b943a18a2e7d84c99fe2ba4a3f034e591 /src/search/dolphinfacetswidget.cpp
parent897ce8480c9c281f0501d201e33b6b0e8e7dd9a6 (diff)
(search) Fix searching tags with spaces
Summary: Tags containing blank spaces were not handled properly in the search widget. Now we enclose them in quotes and strip the quotes before setting them to the widget. {F7854247} Test Plan: No artifacts when searching tags containing spaces Added test cases to `bin/dolphinquerytest` Reviewers: #dolphin, elvisangelaccio, ngraham, meven Reviewed By: #dolphin, elvisangelaccio, ngraham Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D26369
Diffstat (limited to 'src/search/dolphinfacetswidget.cpp')
-rw-r--r--src/search/dolphinfacetswidget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp
index 33c3cea24..d9943abcd 100644
--- a/src/search/dolphinfacetswidget.cpp
+++ b/src/search/dolphinfacetswidget.cpp
@@ -131,7 +131,11 @@ QStringList DolphinFacetsWidget::searchTerms() const
if (!m_searchTags.isEmpty()) {
for (auto const &tag : m_searchTags) {
- terms << QStringLiteral("tag:%1").arg(tag);
+ if (tag.contains(QLatin1Char(' '))) {
+ terms << QStringLiteral("tag:\"%1\"").arg(tag);
+ } else {
+ terms << QStringLiteral("tag:%1").arg(tag);
+ }
}
}