Package: kde-runtime / 4:17.08.3-2.1

solid-networkstatus-Port-to-libnm.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
From 42df200733673c9385c043e876cccfebd6c616ce Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Wed, 18 Apr 2018 19:08:05 +0200
Subject: [PATCH 2/2] solid-networkstatus: Port to libnm

libnm-util has been deprecated for three years and is eventually going
to disappear.
As libnm has been introduced in NetworkManager 1.0.0, the version checks
are no longer necessary, so drop them.
The NetworkManager.h include is replaced with nm-dbus-interface.h to not
pull in any glib/gio headers.
---
 solid-networkstatus/kded/CMakeLists.txt           | 13 +++++--------
 solid-networkstatus/kded/networkmanagerstatus.cpp | 12 +-----------
 2 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/solid-networkstatus/kded/CMakeLists.txt b/solid-networkstatus/kded/CMakeLists.txt
index 633c7f1394..55ef67158e 100644
--- a/solid-networkstatus/kded/CMakeLists.txt
+++ b/solid-networkstatus/kded/CMakeLists.txt
@@ -8,7 +8,7 @@ set(kded_networkstatus_PART_SRCS
    wicdcustomtypes.cpp
 )
 
-macro_optional_find_package(NetworkManager)
+macro_optional_find_package(NetworkManager 1.0.0)
 set_package_properties(NetworkManager PROPERTIES DESCRIPTION "The NetworkManager headers"
                        URL "http://projects.gnome.org/NetworkManager"
                        TYPE OPTIONAL
@@ -16,13 +16,10 @@ set_package_properties(NetworkManager PROPERTIES DESCRIPTION "The NetworkManager
                       )
 
 if(NETWORKMANAGER_FOUND)
-    macro_ensure_version("0.7.0" ${NETWORKMANAGER_VERSION} NM_0_7)
-    if(NM_0_7)
-        MESSAGE(STATUS "Adding in-process NetworkManager service-wart to kded module")
-        set(kded_networkstatus_PART_SRCS ${kded_networkstatus_PART_SRCS} networkmanagerstatus.cpp)
-        include_directories(${NETWORKMANAGER_INCLUDE_DIRS})
-        add_definitions(-DNM_BACKEND_ENABLED)
-    endif(NM_0_7)
+    MESSAGE(STATUS "Adding in-process NetworkManager service-wart to kded module")
+    set(kded_networkstatus_PART_SRCS ${kded_networkstatus_PART_SRCS} networkmanagerstatus.cpp)
+    include_directories(${NETWORKMANAGER_INCLUDE_DIRS})
+    add_definitions(-DNM_BACKEND_ENABLED)
 endif(NETWORKMANAGER_FOUND)
 
 macro_optional_find_package(QNtrack)
diff --git a/solid-networkstatus/kded/networkmanagerstatus.cpp b/solid-networkstatus/kded/networkmanagerstatus.cpp
index 2a42684cf9..a5f4fcedc4 100644
--- a/solid-networkstatus/kded/networkmanagerstatus.cpp
+++ b/solid-networkstatus/kded/networkmanagerstatus.cpp
@@ -28,11 +28,7 @@
 
 #include <QtDBus/QDBusReply>
 
-#include <NetworkManager.h>
-
-#if !defined(NM_CHECK_VERSION)
-    #define NM_CHECK_VERSION(x,y,z) 0
-#endif
+#include <nm-dbus-interface.h>
 
 NetworkManagerStatus::NetworkManagerStatus( QObject *parent )
     : SystemStatusInterface( parent ),
@@ -85,23 +81,17 @@ Solid::Networking::Status NetworkManagerStatus::convertNmState( uint nmState )
     case NM_STATE_CONNECTING:
         status = Solid::Networking::Connecting;
         break;
-#if NM_CHECK_VERSION(0,8,992)
     case NM_STATE_CONNECTED_LOCAL:
     case NM_STATE_CONNECTED_SITE:
     case NM_STATE_CONNECTED_GLOBAL:
-#else
-    case NM_STATE_CONNECTED:
-#endif
         status = Solid::Networking::Connected;
         break;
     case NM_STATE_DISCONNECTED:
         status = Solid::Networking::Unconnected;
         break;
-#if NM_CHECK_VERSION(0,8,992)
     case NM_STATE_DISCONNECTING:
         status = Solid::Networking::Disconnecting;
         break;
-#endif
     }
 
     return status;
-- 
2.17.0