mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
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:
parent
ed513261b3
commit
eef26737e5
1 changed files with 7 additions and 2 deletions
|
@ -84,13 +84,14 @@ void KNotificationManager::send(KNotification *notification, const bool persiste
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KConfigGroup globalgroup(&m_config, spliteventid.at(0));
|
KConfigGroup globalgroup(&m_config, spliteventid.at(0));
|
||||||
|
const QString globalcomment = globalgroup.readEntry("Comment");
|
||||||
KConfigGroup eventgroup(&m_config, eventid);
|
KConfigGroup eventgroup(&m_config, eventid);
|
||||||
QString eventtitle = notification->title();
|
QString eventtitle = notification->title();
|
||||||
if (eventtitle.isEmpty()) {
|
if (eventtitle.isEmpty()) {
|
||||||
eventtitle = eventgroup.readEntry("Comment");
|
eventtitle = eventgroup.readEntry("Comment");
|
||||||
}
|
}
|
||||||
if (eventtitle.isEmpty()) {
|
if (eventtitle.isEmpty()) {
|
||||||
eventtitle = globalgroup.readEntry("Comment");
|
eventtitle = globalcomment;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString eventtext = notification->text();
|
QString eventtext = notification->text();
|
||||||
|
@ -145,11 +146,15 @@ void KNotificationManager::send(KNotification *notification, const bool persiste
|
||||||
actionscounter++;
|
actionscounter++;
|
||||||
}
|
}
|
||||||
QVariantMap eventhints;
|
QVariantMap eventhints;
|
||||||
|
QString eventapp = globalcomment;
|
||||||
|
if (eventapp.isEmpty()) {
|
||||||
|
eventapp = KGlobal::mainComponent().componentName();
|
||||||
|
}
|
||||||
// NOTE: has to be set to be configurable via plasma notifications applet
|
// NOTE: has to be set to be configurable via plasma notifications applet
|
||||||
eventhints.insert("x-kde-appname", spliteventid.at(0));
|
eventhints.insert("x-kde-appname", spliteventid.at(0));
|
||||||
QDBusReply<uint> notifyreply = m_notificationsiface->call(
|
QDBusReply<uint> notifyreply = m_notificationsiface->call(
|
||||||
QString::fromLatin1("Notify"),
|
QString::fromLatin1("Notify"),
|
||||||
KGlobal::mainComponent().componentName(),
|
eventapp,
|
||||||
eventid,
|
eventid,
|
||||||
eventicon,
|
eventicon,
|
||||||
eventtitle,
|
eventtitle,
|
||||||
|
|
Loading…
Add table
Reference in a new issue