Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 83ed4da7 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Notifications Data Engine] Expose desktop entry and application service name icon

Now that we have "desktop-entry" available, expose this information in the data engine.
This could enable a notification implementation to show the application name or do smarter grouping.
The naming is somewhat suboptimal but "appName" and "appIcon" are already occupied and predate this.
I also didn't just want to overwrite the hints the application gives, especially not the "appIcon" which is used as notification icon.

Differential Revision: https://phabricator.kde.org/D6106
parent 3d85454f
......@@ -209,6 +209,7 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id,
const QString eventId = hints[QStringLiteral("x-kde-eventId")].toString();
const bool skipGrouping = hints[QStringLiteral("x-kde-skipGrouping")].toBool();
const QStringList &urls = hints[QStringLiteral("x-kde-urls")].toStringList();
const QString &desktopEntry = hints[QStringLiteral("desktop-entry")].toString();
// group notifications that have the same title coming from the same app
// or if they are on the "blacklist", honor the skipGrouping hint sent
......@@ -314,6 +315,14 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id,
notificationData.insert(QStringLiteral("isPersistent"), isPersistent);
notificationData.insert(QStringLiteral("expireTimeout"), timeout);
notificationData.insert(QStringLiteral("desktopEntry"), desktopEntry);
KService::Ptr service = KService::serviceByStorageId(desktopEntry);
if (service) {
notificationData.insert(QStringLiteral("appServiceName"), service->name());
notificationData.insert(QStringLiteral("appServiceIcon"), service->icon());
}
bool configurable = false;
if (!appRealName.isEmpty()) {
......
Markdown is supported
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