qtui: Set desktop file name
[quassel.git] / src / qtui / knotificationbackend.cpp
index a3415d5..5282bd7 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <KNotifications/KNotification>
 #include <KNotifyConfig/KNotifyConfigWidget>
+#include <knotifications_version.h>
 
 #include "client.h"
 #include "icon.h"
@@ -65,7 +66,7 @@ void KNotificationBackend::notify(const Notification& n)
     QString message = QString("<b>&lt;%1&gt;</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);
@@ -73,7 +74,11 @@ void KNotificationBackend::notify(const Notification& n)
             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)));