diff options
author | Nicolas Fella <nicolas.fella@gmx.de> | 2020-03-21 02:20:51 +0300 |
---|---|---|
committer | Nicolas Fella <nicolas.fella@gmx.de> | 2020-03-21 02:25:33 +0300 |
commit | 2f54e911b7d23653ca4aa89041e5749726a8c3c5 (patch) | |
tree | d18d02ec6e80e983459672cc6bd289f64107837c /src/gui/systray.cpp | |
parent | 3ca586c464af9acd9506ad39232fd75251ee1636 (diff) |
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 <nicolas.fella@gmx.de>
Diffstat (limited to 'src/gui/systray.cpp')
-rw-r--r-- | src/gui/systray.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<QVariant> args = QList<QVariant>() << 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); |