[empathy] notify-manager: fetch capabilities in _init instead of _constructor



commit 2585245b3a13d640ac9988e7ecff2039ad9275c6
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Nov 13 11:01:14 2009 +0000

    notify-manager: fetch capabilities in _init instead of _constructor

 libempathy-gtk/empathy-notify-manager.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c
index ffcc34f..c3d4406 100644
--- a/libempathy-gtk/empathy-notify-manager.c
+++ b/libempathy-gtk/empathy-notify-manager.c
@@ -53,8 +53,6 @@ notify_manager_constructor (GType type,
     GObjectConstructParam *construct_params)
 {
   GObject *retval;
-  EmpathyNotifyManagerPriv *priv;
-  GList *list, *l;
 
   if (notify_manager != NULL)
     return g_object_ref (notify_manager);
@@ -65,20 +63,6 @@ notify_manager_constructor (GType type,
   notify_manager = EMPATHY_NOTIFY_MANAGER (retval);
   g_object_add_weak_pointer (retval, (gpointer) &notify_manager);
 
-  priv = GET_PRIV (notify_manager);
-
-  /* fetch capabilities */
-  list = notify_get_server_caps ();
-  for (l = list; l != NULL; l = g_list_next (l))
-    {
-      gchar *capa = l->data;
-
-      DEBUG ("add capability: %s", capa);
-      /* owernship of the string is transfered to the hash table */
-      g_hash_table_insert (priv->capabilities, capa, GUINT_TO_POINTER (TRUE));
-    }
-  g_list_free (list);
-
   return retval;
 }
 
@@ -122,11 +106,24 @@ empathy_notify_manager_init (EmpathyNotifyManager *self)
 {
   EmpathyNotifyManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
     EMPATHY_TYPE_NOTIFY_MANAGER, EmpathyNotifyManagerPriv);
+  GList *list, *l;
 
   self->priv = priv;
 
   priv->capabilities = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
       NULL);
+
+  /* fetch capabilities */
+  list = notify_get_server_caps ();
+  for (l = list; l != NULL; l = g_list_next (l))
+    {
+      gchar *capa = l->data;
+
+      DEBUG ("add capability: %s", capa);
+      /* owernship of the string is transfered to the hash table */
+      g_hash_table_insert (priv->capabilities, capa, GUINT_TO_POINTER (TRUE));
+    }
+  g_list_free (list);
 }
 
 EmpathyNotifyManager *



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