From: Nicolas Fella Date: Fri, 20 Mar 2020 23:20:51 +0000 (+0100) Subject: Add desktop-entry hint to notifications X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~287^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2f54e911b7d23653ca4aa89041e5749726a8c3c5;p=nextcloud-desktop.git Add desktop-entry hint to notifications This allows the notification server to map a notification to the program's desktop file, which allows the server to do extra things. For example KDE Plasma adds the Nextcloud icon to the notification and allows to configure notifications from Nextcloud. This is a standard hint from https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#hints Signed-off-by: Nicolas Fella --- diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 081a90b0e..0a5d7bfd5 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -121,8 +121,9 @@ void Systray::showMessage(const QString &title, const QString &message, MessageI { #ifdef USE_FDO_NOTIFICATIONS if (QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) { + const QVariantMap hints = {{QStringLiteral("desktop-entry"), QStringLiteral("com.nextcloud.desktopclient.nextcloud")}}; QList args = QList() << APPLICATION_NAME << quint32(0) << APPLICATION_ICON_NAME - << title << message << QStringList() << QVariantMap() << qint32(-1); + << title << message << QStringList() << hints << qint32(-1); QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify"); method.setArguments(args); QDBusConnection::sessionBus().asyncCall(method);