Added KStatusNotifierItem to NotificationsPlugin

This commit is contained in:
Albert Vaca 2013-08-16 08:12:29 +02:00
parent 46f2fcfbce
commit f087871ee4
2 changed files with 10 additions and 1 deletions

View file

@ -31,7 +31,14 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_notifications", "kdeconnect
NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args) NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args)
: KdeConnectPlugin(parent, 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) bool NotificationsPlugin::receivePackage(const NetworkPackage& np)

View file

@ -31,9 +31,11 @@ class NotificationsPlugin
: public KdeConnectPlugin : public KdeConnectPlugin
{ {
Q_OBJECT Q_OBJECT
KStatusNotifierItem* trayIcon;
public: public:
explicit NotificationsPlugin(QObject *parent, const QVariantList &args); explicit NotificationsPlugin(QObject *parent, const QVariantList &args);
virtual ~NotificationsPlugin();
public Q_SLOTS: public Q_SLOTS:
virtual bool receivePackage(const NetworkPackage& np); virtual bool receivePackage(const NetworkPackage& np);