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 <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-27 01:20:16 +03:00
parent ed513261b3
commit eef26737e5

View file

@ -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<uint> notifyreply = m_notificationsiface->call(
QString::fromLatin1("Notify"),
KGlobal::mainComponent().componentName(),
eventapp,
eventid,
eventicon,
eventtitle,