From eef26737e5a66f61ef4f7152a9aaffcd54a212fc Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 27 Aug 2023 01:20:16 +0300 Subject: [PATCH] kdeui: use the global group comment as application name for the notification questionable but the old implementation was doing it, as for why it is questionable - it is more like a description rather than application name (e.g. "Crash notifier" rather than "kcrash") Signed-off-by: Ivailo Monev --- kdeui/notifications/knotification.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kdeui/notifications/knotification.cpp b/kdeui/notifications/knotification.cpp index b31e7fea..593a0140 100644 --- a/kdeui/notifications/knotification.cpp +++ b/kdeui/notifications/knotification.cpp @@ -84,13 +84,14 @@ void KNotificationManager::send(KNotification *notification, const bool persiste return; } KConfigGroup globalgroup(&m_config, spliteventid.at(0)); + const QString globalcomment = globalgroup.readEntry("Comment"); KConfigGroup eventgroup(&m_config, eventid); QString eventtitle = notification->title(); if (eventtitle.isEmpty()) { eventtitle = eventgroup.readEntry("Comment"); } if (eventtitle.isEmpty()) { - eventtitle = globalgroup.readEntry("Comment"); + eventtitle = globalcomment; } QString eventtext = notification->text(); @@ -145,11 +146,15 @@ void KNotificationManager::send(KNotification *notification, const bool persiste actionscounter++; } QVariantMap eventhints; + QString eventapp = globalcomment; + if (eventapp.isEmpty()) { + eventapp = KGlobal::mainComponent().componentName(); + } // NOTE: has to be set to be configurable via plasma notifications applet eventhints.insert("x-kde-appname", spliteventid.at(0)); QDBusReply notifyreply = m_notificationsiface->call( QString::fromLatin1("Notify"), - KGlobal::mainComponent().componentName(), + eventapp, eventid, eventicon, eventtitle,