From 2585245b3a13d640ac9988e7ecff2039ad9275c6 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 13 Nov 2009 11:01:14 +0000 Subject: notify-manager: fetch capabilities in _init instead of _constructor --- libempathy-gtk/empathy-notify-manager.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c index ffcc34f48..c3d440622 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) ¬ify_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 * -- cgit v1.2.3