diff --git a/libnotificationmanager/notificationfilterproxymodel.cpp b/libnotificationmanager/notificationfilterproxymodel.cpp --- a/libnotificationmanager/notificationfilterproxymodel.cpp +++ b/libnotificationmanager/notificationfilterproxymodel.cpp @@ -137,21 +137,22 @@ return false; } - // If the application isn't configurable in any way, it doesn't deserve to be in the history - // since there's no way for the user to get rid of it there. - if (expired && !sourceIdx.data(Notifications::ConfigurableRole).toBool() - // jobs are never configurable so this only applies to notifications - && sourceIdx.data(Notifications::TypeRole).toInt() == Notifications::NotificationType) { + if (!m_showDismissed && sourceIdx.data(Notifications::DismissedRole).toBool()) { return false; } - if (!m_showDismissed && sourceIdx.data(Notifications::DismissedRole).toBool()) { - return false; + QString desktopEntry = sourceIdx.data(Notifications::DesktopEntryRole).toString(); + if (desktopEntry.isEmpty()) { + // For non-configurable notifications use the fake "@other" category. + if (!sourceIdx.data(Notifications::ConfigurableRole).toBool() + // jobs are never configurable so this only applies to notifications + && sourceIdx.data(Notifications::TypeRole).toInt() == Notifications::NotificationType) { + desktopEntry = QStringLiteral("@other"); + } } // Blacklist takes precedence over whitelist, i.e. when in doubt don't show if (!m_blacklistedDesktopEntries.isEmpty()) { - const QString desktopEntry = sourceIdx.data(Notifications::DesktopEntryRole).toString(); if (!desktopEntry.isEmpty() && m_blacklistedDesktopEntries.contains(desktopEntry)) { return false; } @@ -165,7 +166,6 @@ } if (!m_whitelistedDesktopEntries.isEmpty()) { - const QString desktopEntry = sourceIdx.data(Notifications::DesktopEntryRole).toString(); if (!desktopEntry.isEmpty() && m_whitelistedDesktopEntries.contains(desktopEntry)) { return true; } diff --git a/libnotificationmanager/plasmanotifyrc b/libnotificationmanager/plasmanotifyrc --- a/libnotificationmanager/plasmanotifyrc +++ b/libnotificationmanager/plasmanotifyrc @@ -9,3 +9,8 @@ # Klipper notifications might contain sensitive information [Applications][org.kde.klipper] ShowInHistory=false + +# Non-configurable applications don't deserve to be in history by default +[Applications][@other] +ShowInHistory=false +ShowBadges=false # wouldn't work anyway