dhcpcd-qt: Add support for KDE5 Notifications
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-qt.cpp
index 3730c2a9b90604ed85b1a127018f343805c037b4..f4d54a3f222387d142ea6e3575bdf482a95d229b 100644 (file)
 #include "dhcpcd-ifmenu.h"
 #include "dhcpcd-ssidmenu.h"
 
-#ifdef NOTIFY
+
+#if defined(KNOTIFY5)
+#include <KNotification>
+#elif defined(KNOTIFY4)
 #include <knotification.h>
 #endif
 
@@ -538,8 +541,9 @@ void DhcpcdQt::notify(const QString &title, const QString &msg,
     const QString &icon)
 {
 
-#ifdef NOTIFY
+#if defined(KNOTIFY4) || defined(KNOTIFY5)
        KNotification *n = new KNotification("event", this);
+       n->setIconName(icon);
        n->setTitle(title);
        n->setText(msg);
        n->sendEvent();