client: port to libnm

libnm-glib has been deprecated for three years and is eventually going
to disappear.

Change-Id: I98d9ba04c1dfa06ba61f4097ba165fda37edc0e0
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a4e426..81b84a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,7 +92,7 @@
 PKG_CHECK_MODULES(LIBNOTIFY libnotify>=0.7.6) #optional
 FIND_PACKAGE(Gettext) #optional for translations
 PKG_CHECK_MODULES(LIBQRENCODE libqrencode>=3.4)
-PKG_CHECK_MODULES(LIBNM libnm-glib>=0.9.8.8) #optional to detect changes in the network
+PKG_CHECK_MODULES(LIBNM libnm>=1.0) #optional to detect changes in the network
 PKG_CHECK_MODULES(APPINDICATOR appindicator3-0.1) #optional, ideal for use with Unity
 
 PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0)
diff --git a/src/ring_client.cpp b/src/ring_client.cpp
index 63c443e..948f90d 100644
--- a/src/ring_client.cpp
+++ b/src/ring_client.cpp
@@ -75,7 +75,7 @@
 #endif
 
 #if USE_LIBNM
-#include <libnm-glib/nm-client.h>
+#include <NetworkManager.h>
 #endif
 
 struct _RingClientClass
@@ -435,7 +435,7 @@
         priv->nm_client = nm_client;
         g_debug("NetworkManager client initialized, version: %s\ndaemon running: %s\nnnetworking enabled: %s",
                 nm_client_get_version(nm_client),
-                nm_client_get_manager_running(nm_client) ? "yes" : "no",
+                nm_client_get_nm_running(nm_client) ? "yes" : "no",
                 nm_client_networking_get_enabled(nm_client) ? "yes" : "no");
 
         auto connection = nm_client_get_primary_connection(nm_client);