From e919c7facdcfc3c88fa17aac3df495833999231c Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 28 Jun 2016 22:01:27 -0700 Subject: [PATCH] libnm-glib is deprecated and may not be available. This patch switches to use the new libnm API, also since nm_client_new also takes a GError, I thought I'd report the error message if mission-control can't connect to network manager. --- configure.ac | 2 +- src/connectivity-monitor.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 5be3c80..f999ce6 100644 --- a/configure.ac +++ b/configure.ac @@ -193,7 +193,7 @@ if test "x$with_connectivity" = "xno" || test "x$with_connectivity" = "xconnman" else PKG_CHECK_MODULES(NETWORK_MANAGER, [ - libnm-glib >= 0.7.0 + libnm ], have_nm="yes", have_nm="no") if test "x$have_nm" = "xyes"; then diff --git a/src/connectivity-monitor.c b/src/connectivity-monitor.c index 288d6f5..e0dccc7 100644 --- a/src/connectivity-monitor.c +++ b/src/connectivity-monitor.c @@ -32,7 +32,7 @@ #endif #ifdef HAVE_NM -#include +#include #endif #include @@ -459,6 +459,7 @@ static void mcd_connectivity_monitor_init (McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv; + GError *error; priv = G_TYPE_INSTANCE_GET_PRIVATE (connectivity_monitor, MCD_TYPE_CONNECTIVITY_MONITOR, McdConnectivityMonitorPrivate); @@ -487,7 +488,7 @@ mcd_connectivity_monitor_init (McdConnectivityMonitor *connectivity_monitor) #endif #ifdef HAVE_NM - priv->nm_client = nm_client_new (); + priv->nm_client = nm_client_new (NULL, &error); if (priv->nm_client != NULL) { priv->state_change_signal_id = g_signal_connect (priv->nm_client, @@ -498,7 +499,7 @@ mcd_connectivity_monitor_init (McdConnectivityMonitor *connectivity_monitor) } else { - DEBUG ("Failed to get NetworkManager proxy"); + DEBUG ("Failed to get NetworkManager proxy: %s", error->message); } #endif -- 2.8.1