Do not show notifications already present in the device as new
This commit is contained in:
parent
0ae7cdb950
commit
71f9f9dc07
1 changed files with 11 additions and 6 deletions
|
@ -51,6 +51,17 @@ void NotificationsDbusInterface::processPackage(const NetworkPackage& np)
|
||||||
} else {
|
} else {
|
||||||
Notification* noti = new Notification(np, this);
|
Notification* noti = new Notification(np, this);
|
||||||
addNotification(noti);
|
addNotification(noti);
|
||||||
|
|
||||||
|
if (!np.get<bool>("requestAnswer", false)) { //Do not show notifications for answers to a initial request
|
||||||
|
KNotification* notification = new KNotification("notification");
|
||||||
|
notification->setPixmap(KIcon("preferences-desktop-notification").pixmap(48, 48));
|
||||||
|
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
|
||||||
|
notification->setTitle(mDevice->name());
|
||||||
|
notification->setText(noti->appName() + ": " + noti->ticker());
|
||||||
|
notification->sendEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,12 +83,6 @@ void NotificationsDbusInterface::addNotification(Notification* noti)
|
||||||
QDBusConnection::sessionBus().registerObject(mDevice->dbusPath()+"/notifications/"+publicId, noti, QDBusConnection::ExportScriptableContents);
|
QDBusConnection::sessionBus().registerObject(mDevice->dbusPath()+"/notifications/"+publicId, noti, QDBusConnection::ExportScriptableContents);
|
||||||
Q_EMIT notificationPosted(publicId);
|
Q_EMIT notificationPosted(publicId);
|
||||||
|
|
||||||
KNotification* notification = new KNotification("notification");
|
|
||||||
notification->setPixmap(KIcon("preferences-desktop-notification").pixmap(48, 48));
|
|
||||||
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
|
|
||||||
notification->setTitle(mDevice->name());
|
|
||||||
notification->setText(noti->appName() + ": " + noti->ticker());
|
|
||||||
notification->sendEvent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotificationsDbusInterface::removeNotification(const QString& internalId)
|
void NotificationsDbusInterface::removeNotification(const QString& internalId)
|
||||||
|
|
Loading…
Reference in a new issue