]> cloud.milkyroute.net Git - dolphin.git/commitdiff
search/facetswidget: Check for protocol before trying to fetch tags
authorIsmael Asensio <isma.af@gmail.com>
Sun, 9 May 2021 19:10:44 +0000 (21:10 +0200)
committerIsmael Asensio <isma.af@gmail.com>
Mon, 10 May 2021 12:05:35 +0000 (14:05 +0200)
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

index d4079f1eb2258d451b7ff0011e75285047a7d9c9..e8a43101fe2e4b171c7ac49c01acf3c6e84d7e5c 100644 (file)
@@ -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)