]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve placeholder message for unassigned tag
authorNicolas Fella <nicolas.fella@gmx.de>
Thu, 27 Jan 2022 23:46:13 +0000 (00:46 +0100)
committerNate Graham <nate@kde.org>
Mon, 31 Jan 2022 18:16:29 +0000 (18:16 +0000)
When opening tags:/ we show 'No tags' when there are no tags found.

When opening a tag that exists but doesn't have any files associated we show the same message, which isnt't appropriate.

Instead show "No files tagged with 'foo'", which makes more sense

src/views/dolphinview.cpp

index 0a9783fe13092c16ec3cdbca5fb792c10e005576..5646fa9828ccabdcad33ffe746f682a58d2cb8bd 100644 (file)
@@ -2166,7 +2166,13 @@ void DolphinView::updatePlaceholderLabel()
     } else if (m_url.scheme() == QLatin1String("trash") && m_url.path() == QLatin1String("/")) {
         m_placeholderLabel->setText(i18n("Trash is empty"));
     } else if (m_url.scheme() == QLatin1String("tags")) {
-        m_placeholderLabel->setText(i18n("No tags"));
+        if (m_url.path() == QLatin1Char('/')) {
+            m_placeholderLabel->setText(i18n("No tags"));
+        } else {
+            const QString tagName = m_url.path().mid(1); // Remove leading /
+            m_placeholderLabel->setText(i18n("No files tagged with \"%1\"", tagName));
+        }
+
     } else if (m_url.scheme() == QLatin1String("recentlyused")) {
         m_placeholderLabel->setText(i18n("No recently used items"));
     } else if (m_url.scheme() == QLatin1String("smb")) {