From e3cca98e0dc482e281198c0d2f8301a736c52280 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 8 May 2019 22:19:47 +0200 Subject: [PATCH] Fix name and set desktop entry for notifications Summary: With the Plasma notification rewrite the name passed with the notification is user-visible, so use "Falkon" instead of "falkon here". Also pass the desktop entry. This allows Plasma to embed the app icon in the notification Test Plan: Before: {F6815655} After: {F6815657} Reviewers: #falkon, drosca Reviewed By: #falkon, drosca Subscribers: kossebau, broulik, falkon Tags: #falkon Differential Revision: https://phabricator.kde.org/D21087 --- src/lib/notifications/desktopnotificationsfactory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/notifications/desktopnotificationsfactory.cpp b/src/lib/notifications/desktopnotificationsfactory.cpp index 66db67ac2..624652225 100644 --- a/src/lib/notifications/desktopnotificationsfactory.cpp +++ b/src/lib/notifications/desktopnotificationsfactory.cpp @@ -90,15 +90,19 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS tmp.open(QFile::WriteOnly); icon.save(tmp.fileName()); + const QVariantMap hints { + {QStringLiteral("desktop-entry"), QGuiApplication::desktopFileName()} + }; + QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus()); QVariantList args; - args.append(QLatin1String("falkon")); + args.append(QLatin1String("Falkon")); args.append(m_uint); args.append(tmp.fileName()); args.append(heading); args.append(text); args.append(QStringList()); - args.append(QVariantMap()); + args.append(hints); args.append(m_timeout); dbus.callWithCallback("Notify", args, this, SLOT(updateLastId(QDBusMessage)), SLOT(error(QDBusError))); #endif