From: Frederic Peters Date: Wed, 20 Aug 2008 18:51:17 +0000 (+0000) Subject: don't list profiles twice. (closes: #548578) X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18 don't list profiles twice. (closes: #548578) svn path=/trunk/; revision=1364 --- diff --git a/libempathy-gtk/empathy-profile-chooser.c b/libempathy-gtk/empathy-profile-chooser.c index 578bd2a4..fd68dd8b 100644 --- a/libempathy-gtk/empathy-profile-chooser.c +++ b/libempathy-gtk/empathy-profile-chooser.c @@ -118,7 +118,7 @@ profile_chooser_sort_func (GtkTreeModel *model, GtkWidget * empathy_profile_chooser_new (void) { - GList *profiles, *l; + GList *profiles, *l, *seen; GtkListStore *store; GtkCellRenderer *renderer; GtkWidget *combo_box; @@ -149,6 +149,7 @@ empathy_profile_chooser_new (void) btf_cm = mc_manager_lookup ("butterfly"); profiles = mc_profiles_list (); + seen = NULL; for (l = profiles; l; l = l->next) { McProfile *profile; McProtocol *protocol; @@ -170,6 +171,11 @@ empathy_profile_chooser_new (void) continue; } + if (g_list_find_custom (seen, unique_name, (GCompareFunc) strcmp)) { + continue; + } + seen = g_list_append (seen, (char*) unique_name); + gtk_list_store_insert_with_values (store, &iter, 0, COL_ICON, mc_profile_get_icon_name (profile), COL_LABEL, mc_profile_get_display_name (profile), @@ -177,6 +183,9 @@ empathy_profile_chooser_new (void) -1); iter_set = TRUE; } + + g_list_free (seen); + if (btf_cm) { g_object_unref (btf_cm); }