aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@src.gnome.org>2008-08-21 02:51:17 +0800
committerFrederic Peters <fpeters@src.gnome.org>2008-08-21 02:51:17 +0800
commit2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18 (patch)
tree44c4d3732978e88ef3249e64faed7a26c6b787b0
parent745582bb0662896e0fc0e7e643203ed9c8046d93 (diff)
downloadgsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar.gz
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar.bz2
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar.lz
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar.xz
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.tar.zst
gsoc2013-empathy-2e7f00d5becd149f1eca4b0fe7d1aca2b4259e18.zip
don't list profiles twice. (closes: #548578)
svn path=/trunk/; revision=1364
-rw-r--r--libempathy-gtk/empathy-profile-chooser.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-profile-chooser.c b/libempathy-gtk/empathy-profile-chooser.c
index 578bd2a4e..fd68dd8b0 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);
}