[empathy] empathy-protocol-chooser: use empathy_connection_managers_call_when_ready



commit 90d96b199a4f4e1912403d52f38581e8c86752a1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jan 21 12:23:50 2010 +0000

    empathy-protocol-chooser: use empathy_connection_managers_call_when_ready

 libempathy-gtk/empathy-protocol-chooser.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index 7b706b0..0dc60d4 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -254,12 +254,16 @@ protocol_chooser_add_cms_list (EmpathyProtocolChooser *protocol_chooser,
 
 static void
 protocol_chooser_cms_ready_cb (EmpathyConnectionManagers *cms,
-    GParamSpec *pspec,
-    EmpathyProtocolChooser *protocol_chooser)
+    const GError *error,
+    gpointer user_data)
 {
-  if (empathy_connection_managers_is_ready (cms))
-    protocol_chooser_add_cms_list
-        (protocol_chooser, empathy_connection_managers_get_cms (cms));
+  EmpathyProtocolChooser *protocol_chooser = user_data;
+
+  if (error != NULL)
+    return;
+
+  protocol_chooser_add_cms_list (protocol_chooser,
+      empathy_connection_managers_get_cms (cms));
 }
 
 static void
@@ -305,12 +309,8 @@ protocol_chooser_constructed (GObject *object)
       "text", COL_LABEL,
       NULL);
 
-  if (empathy_connection_managers_is_ready (priv->cms))
-    protocol_chooser_add_cms_list (protocol_chooser,
-        empathy_connection_managers_get_cms (priv->cms));
-  else
-    g_signal_connect (priv->cms, "notify::ready",
-        G_CALLBACK (protocol_chooser_cms_ready_cb), protocol_chooser);
+  empathy_connection_managers_call_when_ready (priv->cms,
+      protocol_chooser_cms_ready_cb, protocol_chooser);
 
   if (G_OBJECT_CLASS (empathy_protocol_chooser_parent_class)->constructed)
     G_OBJECT_CLASS



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