]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-profile-chooser.c
Add en_GB in gitignore
[empathy.git] / libempathy-gtk / empathy-profile-chooser.c
index f57da854d7a4560aedfe221d50583677df20ee64..fd68dd8b01bd50663d819cf7ef1e272de3d46ff3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007-2008 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -118,12 +118,13 @@ 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;
        GtkTreeIter      iter;
        gboolean         iter_set = FALSE;
+       McManager       *btf_cm;
 
        /* set up combo box with new store */
        store = gtk_list_store_new (COL_COUNT,
@@ -146,10 +147,13 @@ empathy_profile_chooser_new (void)
                                        "text", COL_LABEL,
                                        NULL);
 
+       btf_cm = mc_manager_lookup ("butterfly");
        profiles = mc_profiles_list ();
+       seen = NULL;
        for (l = profiles; l; l = l->next) {
-               McProfile  *profile;
-               McProtocol *protocol;
+               McProfile   *profile;
+               McProtocol  *protocol;
+               const gchar *unique_name;
 
                profile = l->data;
 
@@ -161,6 +165,17 @@ empathy_profile_chooser_new (void)
                }
                g_object_unref (protocol);
 
+               /* Skip MSN-Haze if we have butterfly */
+               unique_name = mc_profile_get_unique_name (profile);
+               if (btf_cm && strcmp (unique_name, "msn-haze") == 0) {
+                       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),
@@ -169,6 +184,12 @@ empathy_profile_chooser_new (void)
                 iter_set = TRUE;
        }
 
+       g_list_free (seen);
+
+       if (btf_cm) {
+               g_object_unref (btf_cm);
+       }
+
        /* Set the profile sort function */
        gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store),
                                         COL_PROFILE,