diff options
author | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-05-03 03:58:04 +0800 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-07 00:30:52 +0800 |
commit | a8833fd63b3bc3856cbd885158cba6b8fca1225a (patch) | |
tree | 4f4996058b4fbe24cd8b4ec7fd2f40644776bda9 | |
parent | d4989c9be7b3c6fa016d703e2a32774d5f74f836 (diff) | |
download | gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar.gz gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar.bz2 gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar.lz gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar.xz gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.tar.zst gsoc2013-empathy-a8833fd63b3bc3856cbd885158cba6b8fca1225a.zip |
Change the type of EmpathyContact.priv.groups to GeeHashSet.
This is to adjust to the newer API for folks_group_details_set_groups().
It's also slightly cleaner than using a hash table to implement a set.
Helps: bgo#648822 - Port Empathy to Folks 0.5.1
-rw-r--r-- | libempathy/empathy-contact.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 44a561b6e..831be25fc 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -69,7 +69,7 @@ typedef struct { * more fields by searching the address using geoclue. */ GHashTable *location; - GHashTable *groups; + GeeHashSet *groups; gchar **client_types; } EmpathyContactPriv; @@ -424,8 +424,7 @@ contact_finalize (GObject *object) DEBUG ("finalize: %p", object); - if (priv->groups != NULL) - g_hash_table_destroy (priv->groups); + g_clear_object (&priv->groups); g_free (priv->alias); g_free (priv->id); g_strfreev (priv->client_types); @@ -789,12 +788,11 @@ empathy_contact_change_group (EmpathyContact *contact, const gchar *group, * does */ if (priv->groups == NULL) { - priv->groups = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - NULL); + priv->groups = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, + g_free, g_str_hash, g_str_equal); } - g_hash_table_insert (priv->groups, g_strdup (group), - GUINT_TO_POINTER (is_member)); + gee_collection_add (GEE_COLLECTION (priv->groups), group); } EmpathyAvatar * @@ -949,8 +947,8 @@ empathy_contact_set_persona (EmpathyContact *contact, if (priv->groups != NULL) { folks_group_details_set_groups (FOLKS_GROUP_DETAILS (persona), - priv->groups); - g_hash_table_destroy (priv->groups); + GEE_SET (priv->groups)); + g_object_unref (priv->groups); priv->groups = NULL; } } |