X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fknotificationbackend.cpp;h=68717cd4717fd22623fd00480cbc1275691ff0d2;hp=a3415d53efbdb946eabb7d1367a59adcc6fda472;hb=HEAD;hpb=1a9c8338d0056fd3e3df46cbae4bce5969566b5b diff --git a/src/qtui/knotificationbackend.cpp b/src/qtui/knotificationbackend.cpp index a3415d53..903446ac 100644 --- a/src/qtui/knotificationbackend.cpp +++ b/src/qtui/knotificationbackend.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 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)));