]> git.0d.be Git - empathy.git/commitdiff
Makes easier to change to profile order.
authorXavier Claessens <xclaesse@gmail.com>
Sat, 28 Jul 2007 21:18:38 +0000 (21:18 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sat, 28 Jul 2007 21:18:38 +0000 (21:18 +0000)
2007-07-28 Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-profile-chooser.c: Makes easier to change to
profile order.

svn path=/trunk/; revision=210

ChangeLog
libempathy-gtk/empathy-profile-chooser.c

index 0d84683d93e59c29feb13f6e446480527692f46e..763e8dcd32f8d6c070acf0be2afdd2a3270a96b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-28 Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-profile-chooser.c: Makes easier to change to
+       profile order.
+
 2007-07-28 Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-account-widget-jabber.c: Try to guess the
index a03da1750e71d653000ba3ec876a916500ac6af8..f1d508ffc39555711e0d30270391695822701c2d 100644 (file)
@@ -55,26 +55,21 @@ empathy_profile_chooser_get_selected (GtkWidget *widget)
 static gint
 profile_chooser_sort_profile_value (McProfile *profile)
 {
-       const gchar *name;
-
-       name = mc_profile_get_unique_name (profile);
-
-       /* Jabber is the prefered protocol, salut is a free protocol so it
-        * should be at the begining of the list, and google talk uses the
-        * free jabber protocol so it gets the 3rd place.
-        * FIXME: Add other free protocols in this list.
-        */
-       if (strcmp (name, "jabber") == 0) {
-               return 0;
-       }
-       else if (strcmp (name, "salut") == 0) {
-               return 1;
-       }
-       else if (strcmp (name, "gtalk") == 0) {
-               return 2;
+       guint        i;
+       const gchar *profile_name;
+       const gchar *names[] = {"jabber",
+                               "salut",
+                               "gtalk"};
+
+       profile_name = mc_profile_get_unique_name (profile);
+
+       for (i = 0 ; i < G_N_ELEMENTS (names); i++) {
+               if (strcmp (profile_name, names[i]) == 0) {
+                       return i;
+               }
        }
 
-       return 3;
+       return i;
 }
 
 static gint