summaryrefslogtreecommitdiff
blob: 5636d0532ed4c2bfc3cab8f4385b67f2ed0bf656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 29636baff0f0cf8d769aa75b1c458b96cf83b828 Mon Sep 17 00:00:00 2001
From: Ismael Asensio <isma.af@gmail.com>
Date: Sun, 9 May 2021 21:10:44 +0200
Subject: [PATCH] search/facetswidget: Check for protocol before trying to
 fetch tags

This was causing an error when trying to list items from the
non-existent `tags:` protocol.

BUG: 435586
FIXED-IN: 21.04.1
---
 src/search/dolphinfacetswidget.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/search/dolphinfacetswidget.cpp b/src/search/dolphinfacetswidget.cpp
index d4079f1eb..e8a43101f 100644
--- a/src/search/dolphinfacetswidget.cpp
+++ b/src/search/dolphinfacetswidget.cpp
@@ -8,6 +8,7 @@
 #include "dolphinfacetswidget.h"
 
 #include <KLocalizedString>
+#include <KProtocolInfo>
 
 #include <QComboBox>
 #include <QDate>
@@ -245,7 +246,9 @@ void DolphinFacetsWidget::updateTagsSelector()
 void DolphinFacetsWidget::updateTagsMenu()
 {
     updateTagsMenuItems({}, {});
-    m_tagsLister.openUrl(QUrl(QStringLiteral("tags:/")), KCoreDirLister::OpenUrlFlag::Reload);
+    if (KProtocolInfo::isKnownProtocol(QStringLiteral("tags"))) {
+        m_tagsLister.openUrl(QUrl(QStringLiteral("tags:/")), KCoreDirLister::OpenUrlFlag::Reload);
+    }
 }
 
 void DolphinFacetsWidget::updateTagsMenuItems(const QUrl&, const KFileItemList& items)
-- 
GitLab