Added KStatusNotifierItem to NotificationsPlugin
This commit is contained in:
parent
46f2fcfbce
commit
f087871ee4
2 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||||
|
|
|
@ -31,10 +31,12 @@ 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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue