[empathy] accounts-dialog: use GNetworkMonitor



commit 0c787fdf8c043331b4857c6bf3ec08936467e42b
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Mar 28 10:26:39 2012 +0200

    accounts-dialog: use GNetworkMonitor

 src/empathy-accounts-dialog.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 9a07325..af85fd6 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -40,7 +40,6 @@
 
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-connection-managers.h>
-#include <libempathy/empathy-connectivity.h>
 #include <libempathy/empathy-pkg-kit.h>
 #include <libempathy/empathy-tp-contact-factory.h>
 
@@ -134,7 +133,7 @@ typedef struct {
 
   TpAccountManager *account_manager;
   EmpathyConnectionManagers *cms;
-  EmpathyConnectivity *connectivity;
+  GNetworkMonitor *connectivity;
 
   GtkWindow *parent_window;
   TpAccount *initial_selection;
@@ -464,7 +463,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
                 g_free (message);
               }
 
-            if (!empathy_connectivity_is_online (priv->connectivity))
+            if (!g_network_monitor_get_network_available (priv->connectivity))
                accounts_dialog_status_infobar_set_message (dialog,
                     _("Offline â No Network Connection"));
 
@@ -2566,6 +2565,12 @@ do_dispose (GObject *obj)
       priv->connecting_id = 0;
     }
 
+  if (priv->connectivity)
+    {
+      g_object_unref (priv->connectivity);
+      priv->connectivity = NULL;
+    }
+
   if (priv->account_manager != NULL)
     {
       g_object_unref (priv->account_manager);
@@ -2578,12 +2583,6 @@ do_dispose (GObject *obj)
       priv->cms = NULL;
     }
 
-  if (priv->connectivity)
-    {
-      g_object_unref (priv->connectivity);
-      priv->connectivity = NULL;
-    }
-
   if (priv->initial_selection != NULL)
     {
       g_object_unref (priv->initial_selection);
@@ -2651,7 +2650,8 @@ do_constructed (GObject *object)
   tp_proxy_prepare_async (priv->account_manager, NULL,
       accounts_dialog_manager_ready_cb, dialog);
 
-  priv->connectivity = empathy_connectivity_dup_singleton ();
+  priv->connectivity = g_network_monitor_get_default ();
+  g_object_ref (priv->connectivity);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]