/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <KNotifications/KNotification>
#include <KNotifyConfig/KNotifyConfigWidget>
+#include <knotifications_version.h>
#include "client.h"
#include "icon.h"
QString message = QString("<b><%1></b> %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);
selectOverload<uint>(&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<KNotification>(notification)));