Commit 3a20578f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications] Take application name from desktop name

In case no application name is set but we found a service, use the service name.
Also prefer the service name when the application name just looks like the desktop
entry, e.g. VLC just sets "vlc" as application name, which we would then override
to "VLC media player" from the vlc.desktop we might have found.

This is actually mostly just preparation for should we add a look up of the desktop
entry through the process CGroup.
parent 42068e17
......@@ -194,6 +194,15 @@ uint ServerPrivate::Notify(const QString &app_name, uint replaces_id, const QStr
if (!desktopEntry.isEmpty()) {
qCDebug(NOTIFICATIONMANAGER) << "Resolved notification to be from desktop entry" << desktopEntry;
// No application name? Set it to the service name, which is nicer than the process name fallback below
// Also if the title looks like it's just the desktop entry, use the nicer service name
if (notification.applicationName().isEmpty() || notification.applicationName() == desktopEntry) {
KService::Ptr service = KService::serviceByDesktopName(desktopEntry);
if (service) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment