projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PR-540] Add a new feature flag
[quassel.git]
/
src
/
qtui
/
knotificationbackend.cpp
diff --git
a/src/qtui/knotificationbackend.cpp
b/src/qtui/knotificationbackend.cpp
index
201b112
..
8d1b4cd
100644
(file)
--- a/
src/qtui/knotificationbackend.cpp
+++ b/
src/qtui/knotificationbackend.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-20
18
by the Quassel Project *
+ * Copyright (C) 2005-20
20
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-25,6
+25,7
@@
#include <KNotifications/KNotification>
#include <KNotifyConfig/KNotifyConfigWidget>
#include <KNotifications/KNotification>
#include <KNotifyConfig/KNotifyConfigWidget>
+#include <knotifications_version.h>
#include "client.h"
#include "icon.h"
#include "client.h"
#include "icon.h"
@@
-65,7
+66,7
@@
void KNotificationBackend::notify(const Notification& n)
QString message = QString("<b><%1></b> %2").arg(n.sender, n.message.toHtmlEscaped());
KNotification* notification = KNotification::event(type,
message,
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);
QtUi::mainWindow(),
KNotification::RaiseWidgetOnActivation | KNotification::CloseWhenWidgetActivated
| KNotification::CloseOnTimeout);
@@
-73,7
+74,11
@@
void KNotificationBackend::notify(const Notification& n)
selectOverload<uint>(&KNotification::activated),
this,
selectOverload<>(&KNotificationBackend::notificationActivated));
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)));
notification->setProperty("notificationId", n.notificationId);
_notifications.append(qMakePair(n.notificationId, QPointer<KNotification>(notification)));