┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search
diff options
context:
space:
mode:
authorChristoph Feck <[email protected]>2020-08-05 09:43:32 +0200
committerChristoph Feck <[email protected]>2020-08-05 09:43:32 +0200
commit5c41350eec59e28d12a1ba7c0fc47a09625d3808 (patch)
tree31d27dd6f23b5e9ae0ca556380d6b20f6ceecb60 /src/search
parente9e74dcad94a52fb36ec9639049f01f93d6c8af4 (diff)
parent73cac464c5db30ad60b886b8c65c2d1599310d8d (diff)
Merge branch 'master' of invent.kde.org:system/dolphin
Diffstat (limited to 'src/search')
-rw-r--r--src/search/dolphinfacetswidget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp
index d9943abcd..8bae83887 100644
--- a/src/search/dolphinfacetswidget.cpp
+++ b/src/search/dolphinfacetswidget.cpp
@@ -272,12 +272,14 @@ void DolphinFacetsWidget::updateTagsMenuItems(const QUrl&, const KFileItemList&
allTags.sort(Qt::CaseInsensitive);
allTags.removeDuplicates();
+ const bool onlyOneTag = allTags.count() == 1;
+
for (const QString& tagName : qAsConst(allTags)) {
QAction* action = m_tagsSelector->menu()->addAction(QIcon::fromTheme(QStringLiteral("tag")), tagName);
action->setCheckable(true);
action->setChecked(m_searchTags.contains(tagName));
- connect(action, &QAction::triggered, this, [this, tagName](bool isChecked) {
+ connect(action, &QAction::triggered, this, [this, tagName, onlyOneTag](bool isChecked) {
if (isChecked) {
addSearchTag(tagName);
} else {
@@ -285,7 +287,9 @@ void DolphinFacetsWidget::updateTagsMenuItems(const QUrl&, const KFileItemList&
}
emit facetChanged();
- m_tagsSelector->menu()->show();
+ if (!onlyOneTag) {
+ m_tagsSelector->menu()->show();
+ }
});
}