summaryrefslogtreecommitdiff
path: root/notificationmonitor_p.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-01-08 01:39:22 +0100
committerJavier <dev.git@javispedro.com>2016-01-08 01:39:22 +0100
commit5f0258acc1c18db4f1bc40e40cdb01a9f0e16ab2 (patch)
tree18f439926a641410d6e0416892e8216723ba79dd /notificationmonitor_p.h
parent87a7e79f3306558176c97a9f82c63949bbf214c7 (diff)
downloadlibwatchfish-5f0258acc1c18db4f1bc40e40cdb01a9f0e16ab2.tar.gz
libwatchfish-5f0258acc1c18db4f1bc40e40cdb01a9f0e16ab2.zip
replace sender with appId and appName
Diffstat (limited to 'notificationmonitor_p.h')
-rw-r--r--notificationmonitor_p.h17
1 files changed, 16 insertions, 1 deletions
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<QString,QString> 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<quint32, ProtoNotification> _pendingConfirmation;
/** Cache of notification category info. */
mutable QHash<QString, NotificationCategoryCacheEntry> _categoryCache;
+ /** Cache of application names. */
+ mutable QHash<QString, AppNameCacheEntry> _appNameCache;
};