]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-connectivity.c
local-xmpp-assistant-widget: increase row-spacing
[empathy.git] / libempathy / empathy-connectivity.c
index 77c715a04fe5c093d79dcd8dd548824889694124..f84505f9bd9426d5ba99ec32d0190216ef811eb0 100644 (file)
@@ -33,7 +33,6 @@
 #include <telepathy-glib/util.h>
 
 #include "empathy-utils.h"
-#include "empathy-marshal.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONNECTIVITY
 #include "empathy-debug.h"
@@ -87,6 +86,11 @@ connectivity_change_state (EmpathyConnectivity *connectivity,
 }
 
 #ifdef HAVE_NM
+
+#if !defined(NM_CHECK_VERSION)
+#define NM_CHECK_VERSION(x,y,z) 0
+#endif
+
 static void
 connectivity_nm_state_change_cb (NMClient *client,
     const GParamSpec *pspec,
@@ -103,10 +107,14 @@ connectivity_nm_state_change_cb (NMClient *client,
 
   state = nm_client_get_state (priv->nm_client);
   new_nm_connected = !(state == NM_STATE_CONNECTING
+#if NM_CHECK_VERSION(0,8,992)
+      || state == NM_STATE_DISCONNECTING
+#endif
+      || state == NM_STATE_ASLEEP
       || state == NM_STATE_DISCONNECTED);
 
-  DEBUG ("New NetworkManager network state %d (connected: %d", state,
-    new_nm_connected);
+  DEBUG ("New NetworkManager network state %d (connected: %s)", state,
+      new_nm_connected ? "true" : "false");
 
   connectivity_change_state (connectivity, new_nm_connected);
 }
@@ -207,11 +215,11 @@ empathy_connectivity_init (EmpathyConnectivity *connectivity)
   if (connection != NULL)
     {
       priv->proxy = dbus_g_proxy_new_for_name (connection,
-          "org.moblin.connman", "/",
-          "org.moblin.connman.Manager");
+          "net.connman", "/",
+          "net.connman.Manager");
 
       dbus_g_object_register_marshaller (
-          _empathy_marshal_VOID__STRING,
+          g_cclosure_marshal_generic,
           G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID);
 
       dbus_g_proxy_add_signal (priv->proxy, "StateChanged",
@@ -230,7 +238,7 @@ empathy_connectivity_init (EmpathyConnectivity *connectivity)
     }
 #endif
 
-#if !defined(HAVE_NM) || !defined(HAVE_CONNMAN)
+#if !defined(HAVE_NM) && !defined(HAVE_CONNMAN)
   priv->connected = TRUE;
 #endif
 }
@@ -355,7 +363,7 @@ empathy_connectivity_class_init (EmpathyConnectivityClass *klass)
         G_SIGNAL_RUN_LAST,
         0,
         NULL, NULL,
-        _empathy_marshal_VOID__BOOLEAN,
+        g_cclosure_marshal_generic,
         G_TYPE_NONE,
         1, G_TYPE_BOOLEAN, NULL);
 
@@ -383,14 +391,7 @@ empathy_connectivity_is_online (EmpathyConnectivity *connectivity)
 {
   EmpathyConnectivityPriv *priv = GET_PRIV (connectivity);
 
-  if (priv->use_conn)
-    {
-      return priv->connected;
-    }
-  else
-    {
-      return TRUE;
-    }
+  return priv->connected;
 }
 
 gboolean
@@ -410,7 +411,7 @@ empathy_connectivity_set_use_conn (EmpathyConnectivity *connectivity,
   if (use_conn == priv->use_conn)
     return;
 
-  DEBUG ("use_conn gconf key changed; new value = %s",
+  DEBUG ("use_conn GSetting key changed; new value = %s",
       use_conn ? "true" : "false");
 
   priv->use_conn = use_conn;