Mark notifications as resident

This means that they are not deleted automatically on timeout and thus can be interacted with from Plasma's history.

The KNotification is parented to the Notification so it gets deleted when the notification is dismissed from the phone or the Plasmoid.
This commit is contained in:
Nicolas Fella 2021-03-17 23:42:50 +01:00
parent 81daf6649e
commit 8d521540a8

View file

@ -92,6 +92,7 @@ void Notification::createKNotification(const NetworkPacket& np)
if (!m_notification) {
m_notification = new KNotification(QStringLiteral("notification"), KNotification::CloseOnTimeout, this);
m_notification->setComponentName(QStringLiteral("kdeconnect"));
m_notification->setHint(QStringLiteral("resident"), true); // This means the notification won't be deleted automatically, but only with KNotifications 5.81
}
QString escapedTitle = m_title.toHtmlEscaped();