dhcpcd-qt: Remove support for KDE Notifications
authorRoy Marples <roy@marples.name>
Sun, 9 Aug 2020 11:10:55 +0000 (12:10 +0100)
committerRoy Marples <roy@marples.name>
Sun, 9 Aug 2020 11:10:55 +0000 (12:10 +0100)
Qt Notifications are fine and highly portable.

KDE Notifications are now more tricky as they require a per app
config file to be installed and of course don't work with
other Qt based desktops.
If anyone wants them back, we should try and create dhcpcd-kde
instead of dhcpcd-qt.

README.md
configure
src/dhcpcd-qt/dhcpcd-qt.cpp

index 6844c5f47afaa465b4d2e4ff6aa9ceaec73c67b1..c4d789b46444a9ccbd2c3344a20e2539c93f10b8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -27,3 +27,9 @@ Switches to control building of various parts:
 For each `--with` there is a `--without` and for each `--enable` a `--disable`.
 If each part is not specified then the configure will test the system
 for the needed libraries to build and install it.
 For each `--with` there is a `--without` and for each `--enable` a `--disable`.
 If each part is not specified then the configure will test the system
 for the needed libraries to build and install it.
+
+### Notifications
+
+Notifications are dependant on the chosen platform.
+GTK+ will get them if libnotify is present.
+Qt will get them by default.
index 3a180198351e5fff8cd91bb4aa11aebe6659348a..bf44bf0657cdf65c3c720e21b766324bb63025f3 100755 (executable)
--- a/configure
+++ b/configure
@@ -434,22 +434,6 @@ if $DHCPCD_QT; then
        QMAKE_CONFIG="$QMAKE_CONFIG PREFIX=$PREFIX"
        QMAKE_CONFIG="$QMAKE_CONFIG SYSCONFDIR=$SYSCONFDIR"
        QMAKE_CONFIG="$QMAKE_CONFIG MANDIR=$MANDIR"
        QMAKE_CONFIG="$QMAKE_CONFIG PREFIX=$PREFIX"
        QMAKE_CONFIG="$QMAKE_CONFIG SYSCONFDIR=$SYSCONFDIR"
        QMAKE_CONFIG="$QMAKE_CONFIG MANDIR=$MANDIR"
-fi
-if $DHCPCD_QT && [ -z "$NOTIFY" -o "$NOTIFY" = yes ]; then
-       printf "Looking for KDE Notification support ... "
-       QT_KNOTE="QT+=KNotifications"
-       if (cd src/dhcpcd-qt; $QMAKE $QMAKE_CONFIG $QT_KNOTE dhcpcd-qt.pro) 2>>config.log; then
-               QMAKE_CONFIG="$QMAKE_CONFIG $QT_KNOTE DEFINES+=KNOTIFY5"
-               echo "KDE5"
-       elif kde4-config --path lib --locate libkdeui.so >/dev/null 2>&3; then
-               QMAKE_CONFIG="$QMAKE_CONFIG CONFIG+=has_libkdeui DEFINES+=KNOTIFY4"
-               echo "KDE4"
-       else
-               echo "none found"
-               [ "$NOTIFY" = yes ] && exit 1
-       fi
-fi
-if $DHCPCD_QT; then
        if (cd src/dhcpcd-qt; $QMAKE $QMAKE_CONFIG dhcpcd-qt.pro); then
                UI="$UI${UI:+ }dhcpcd-qt"
        else
        if (cd src/dhcpcd-qt; $QMAKE $QMAKE_CONFIG dhcpcd-qt.pro); then
                UI="$UI${UI:+ }dhcpcd-qt"
        else
index b9cf703c5ed351776a4042a3ea9476b81e7ef3e9..ab1bfc4735733cb84fe06c95782dac0ac74a0c7f 100644 (file)
 #include "dhcpcd-ifmenu.h"
 #include "dhcpcd-ssidmenu.h"
 
 #include "dhcpcd-ifmenu.h"
 #include "dhcpcd-ssidmenu.h"
 
-#if defined(KNOTIFY5)
-#include <KNotification>
-#elif defined(KNOTIFY4)
-#include <knotification.h>
-#endif
-
 DhcpcdQt::DhcpcdQt()
 {
 
 DhcpcdQt::DhcpcdQt()
 {
 
@@ -539,14 +533,6 @@ void DhcpcdQt::dispatch()
 void DhcpcdQt::notify(const QString &title, const QString &msg,
     const QString &icon)
 {
 void DhcpcdQt::notify(const QString &title, const QString &msg,
     const QString &icon)
 {
-
-#if defined(KNOTIFY4) || defined(KNOTIFY5)
-       KNotification *n = new KNotification("event", this);
-       n->setIconName(icon);
-       n->setTitle(title);
-       n->setText(msg);
-       n->sendEvent();
-#else
 #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
        const QIcon i = getIcon("status", icon);
 #else
 #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
        const QIcon i = getIcon("status", icon);
 #else
@@ -556,7 +542,6 @@ void DhcpcdQt::notify(const QString &title, const QString &msg,
                i = QSystemTrayIcon::Warning;
 #endif
        trayIcon->showMessage(title, msg, i);
                i = QSystemTrayIcon::Warning;
 #endif
        trayIcon->showMessage(title, msg, i);
-#endif
 }
 
 void DhcpcdQt::closeEvent(QCloseEvent *event)
 }
 
 void DhcpcdQt::closeEvent(QCloseEvent *event)