From 5f0258acc1c18db4f1bc40e40cdb01a9f0e16ab2 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 8 Jan 2016 01:39:22 +0100 Subject: replace sender with appId and appName --- notificationmonitor_p.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'notificationmonitor_p.h') diff --git a/notificationmonitor_p.h b/notificationmonitor_p.h index 069abc4..2f57697 100644 --- a/notificationmonitor_p.h +++ b/notificationmonitor_p.h @@ -9,6 +9,9 @@ #define CATEGORY_DEFINITION_FILE_DIRECTORY "/usr/share/lipstick/notificationcategories" #define CATEGORY_REFRESH_CHECK_TIME 120 +#define DESKTOP_FILE_DIRECTORY "/usr/share/applications" +#define DESKTOP_REFRESH_CHECK_TIME 120 + namespace watchfish { @@ -19,9 +22,17 @@ struct NotificationCategoryCacheEntry QDateTime lastCheckTime; }; +struct AppNameCacheEntry +{ + QString name; + QDateTime lastReadTime; + QDateTime lastCheckTime; +}; + struct ProtoNotification { - QString sender; + QString appId; + QString appName; QString appIcon; QString summary; QString body; @@ -55,6 +66,8 @@ private: QHash getCategoryInfo(const QString &s) const; + QString getAppName(const QString &id) const; + static dbus_bool_t busWatchAdd(DBusWatch *watch, void *data); static void busWatchRemove(DBusWatch *watch, void *data); static void busWatchToggle(DBusWatch *watch, void *data); @@ -76,6 +89,8 @@ private: QHash _pendingConfirmation; /** Cache of notification category info. */ mutable QHash _categoryCache; + /** Cache of application names. */ + mutable QHash _appNameCache; }; -- cgit v1.2.3