X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fknotificationbackend.cpp;h=903446acb1a10da8cfdfc778662af78ee6fffd2a;hp=201b1122c64edf09cbdbbf663e1e792cffad8a8b;hb=HEAD;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/qtui/knotificationbackend.cpp b/src/qtui/knotificationbackend.cpp index 201b1122..903446ac 100644 --- a/src/qtui/knotificationbackend.cpp +++ b/src/qtui/knotificationbackend.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -25,6 +25,7 @@ #include #include +#include #include "client.h" #include "icon.h" @@ -65,7 +66,7 @@ void KNotificationBackend::notify(const Notification& n) QString message = QString("<%1> %2").arg(n.sender, n.message.toHtmlEscaped()); KNotification* notification = KNotification::event(type, message, - icon::get("dialog-information").pixmap(48), + QStringLiteral("dialog-information"), QtUi::mainWindow(), KNotification::RaiseWidgetOnActivation | KNotification::CloseWhenWidgetActivated | KNotification::CloseOnTimeout); @@ -73,7 +74,11 @@ void KNotificationBackend::notify(const Notification& n) selectOverload(&KNotification::activated), this, selectOverload<>(&KNotificationBackend::notificationActivated)); - notification->setActions(QStringList("View")); +#if KNOTIFICATIONS_VERSION >= QT_VERSION_CHECK(5,31,0) + notification->setDefaultAction(tr("View")); +#else + notification->setActions(QStringList{tr("View")}); +#endif notification->setProperty("notificationId", n.notificationId); _notifications.append(qMakePair(n.notificationId, QPointer(notification)));