telepathy-mission-control: libnm-glib is deprecated and may not be available.
George Kiagiadakis
gkiagia at kemper.freedesktop.org
Sat Jan 28 11:43:23 UTC 2017
Module: telepathy-mission-control
Branch: master
Commit: 91499340222a563bacce7994f32275c38ff55ff0
URL: http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=91499340222a563bacce7994f32275c38ff55ff0
Author: Diane Trout <diane at ghic.org>
Date: Wed Jun 29 22:37:24 2016 -0700
libnm-glib is deprecated and may not be available.
This patch switches to use th enew libnm API, also snice nm_client_new
now takes a GError, I thought I'd report the error message if mission
control can't connect to the network manager.
Additionally we can remove a definition of the NM_CHECK_VERSION
macro for old versions of NM, as well as a guard for the
NM_STATE_DISCONNECTING constant.
---
configure.ac | 2 +-
src/connectivity-monitor.c | 13 ++++---------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 78af850..c4c8122 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,7 +270,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 8b3d385..bb09096 100644
--- a/src/connectivity-monitor.c
+++ b/src/connectivity-monitor.c
@@ -32,7 +32,7 @@
#endif
#ifdef HAVE_NM
-#include <nm-client.h>
+#include <NetworkManager.h>
#endif
#ifdef HAVE_UPOWER
@@ -190,10 +190,6 @@ connectivity_monitor_remove_states (
#ifdef HAVE_NM
-#if !defined(NM_CHECK_VERSION)
-#define NM_CHECK_VERSION(x,y,z) 0
-#endif
-
static void
connectivity_monitor_nm_state_change_cb (NMClient *client,
const GParamSpec *pspec,
@@ -210,9 +206,7 @@ connectivity_monitor_nm_state_change_cb (NMClient *client,
state = nm_client_get_state (priv->nm_client);
if (state == NM_STATE_CONNECTING
-#if NM_CHECK_VERSION(0,8,992)
|| state == NM_STATE_DISCONNECTING
-#endif
|| state == NM_STATE_ASLEEP)
{
DEBUG ("New NetworkManager network state %d (unstable state)", state);
@@ -504,6 +498,7 @@ static void
mcd_connectivity_monitor_init (McdConnectivityMonitor *connectivity_monitor)
{
McdConnectivityMonitorPrivate *priv;
+ GError *error = NULL;
priv = G_TYPE_INSTANCE_GET_PRIVATE (connectivity_monitor,
MCD_TYPE_CONNECTIVITY_MONITOR, McdConnectivityMonitorPrivate);
@@ -532,7 +527,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,
@@ -543,7 +538,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
More information about the telepathy-commits
mailing list