From f087871ee47cd583b69f082aed144dba37295ad3 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 16 Aug 2013 08:12:29 +0200 Subject: [PATCH] Added KStatusNotifierItem to NotificationsPlugin --- daemon/plugins/notifications/notificationsplugin.cpp | 7 +++++++ daemon/plugins/notifications/notificationsplugin.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/daemon/plugins/notifications/notificationsplugin.cpp b/daemon/plugins/notifications/notificationsplugin.cpp index 8eeb73c83..3a6b3e26f 100644 --- a/daemon/plugins/notifications/notificationsplugin.cpp +++ b/daemon/plugins/notifications/notificationsplugin.cpp @@ -31,7 +31,14 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_notifications", "kdeconnect NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { + trayIcon = new KStatusNotifierItem(parent); + trayIcon->setIconByName("smartphone"); + trayIcon->setTitle(device()->name()); +} +NotificationsPlugin::~NotificationsPlugin() +{ + delete trayIcon; } bool NotificationsPlugin::receivePackage(const NetworkPackage& np) diff --git a/daemon/plugins/notifications/notificationsplugin.h b/daemon/plugins/notifications/notificationsplugin.h index 37b6d88db..55f2528e4 100644 --- a/daemon/plugins/notifications/notificationsplugin.h +++ b/daemon/plugins/notifications/notificationsplugin.h @@ -31,10 +31,12 @@ class NotificationsPlugin : public KdeConnectPlugin { Q_OBJECT + KStatusNotifierItem* trayIcon; public: explicit NotificationsPlugin(QObject *parent, const QVariantList &args); - + virtual ~NotificationsPlugin(); + public Q_SLOTS: virtual bool receivePackage(const NetworkPackage& np);