commit 77e237ca4f9fd1f5cc1a81df6f707b0ecff60fa9
Author: Hans Petter Jansson <hpj@cl.no>
Date:   Fri Feb 5 23:39:14 2010 +0100

    Patch 10: gdm-2.23.92-filter-dupes-from-lang-list.patch

Index: gdm-2.24.0/gui/simple-greeter/gdm-language-option-widget.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-language-option-widget.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-language-option-widget.c
@@ -173,7 +173,7 @@ gdm_language_option_widget_class_init (G
         g_type_class_add_private (klass, sizeof (GdmLanguageOptionWidgetPrivate));
 }
 
-static gboolean
+static char *
 gdm_language_option_widget_lookup_item (GdmRecentOptionWidget *widget,
                                         const char            *locale,
                                         char                 **name,
@@ -182,11 +182,15 @@ gdm_language_option_widget_lookup_item (
         char *language;
         char *readable_language;
         char *lang_tag;
+        char *normalized_locale;
 
-        language = gdm_get_language_from_name (locale, locale);
+        normalized_locale = gdm_normalize_language_name (locale);
+
+        language = gdm_get_language_from_name (locale, normalized_locale);
 
         if (language == NULL) {
-                return FALSE;
+                g_free (normalized_locale);
+                return NULL;
         }
 
         readable_language = gdm_get_language_from_name (locale, NULL);
@@ -197,7 +201,7 @@ gdm_language_option_widget_lookup_item (
         g_free (language);
         g_free (lang_tag);
 
-        return TRUE;
+        return normalized_locale;
 }
 
 static void
@@ -294,7 +298,7 @@ gdm_language_option_widget_set_current_l
 
         if (normalized_language_name != NULL &&
             !gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget),
-                                            normalized_language_name, NULL, NULL, NULL)) {
+                                            &normalized_language_name, NULL, NULL, NULL)) {
                 gdm_recent_option_widget_add_item (GDM_RECENT_OPTION_WIDGET (widget),
                                                    normalized_language_name);
         }
Index: gdm-2.24.0/gui/simple-greeter/gdm-layout-option-widget.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-layout-option-widget.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-layout-option-widget.c
@@ -176,24 +176,24 @@ gdm_layout_option_widget_class_init (Gdm
         g_type_class_add_private (klass, sizeof (GdmLayoutOptionWidgetPrivate));
 }
 
-static gboolean
+static char *
 gdm_layout_option_widget_lookup_item (GdmRecentOptionWidget *widget,
-                                      const char            *id,
+                                      const char            *key,
                                       char                 **name,
                                       char                 **comment)
 {
         char *layout;
 
-        layout = gdm_get_layout_from_name (id);
+        layout = gdm_get_layout_from_name (key);
 
         if (layout == NULL) {
-                return FALSE;
+                return NULL;
         }
 
         *name = layout;
         *comment = NULL;
 
-        return TRUE;
+        return g_strdup (key);
 }
 
 static void
Index: gdm-2.24.0/gui/simple-greeter/gdm-recent-option-widget.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-recent-option-widget.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-recent-option-widget.c
@@ -158,7 +158,8 @@ gdm_recent_option_widget_sync_items_from
         default_is_set = FALSE;
 
         for (tmp = list; tmp != NULL; tmp = tmp->next) {
-                const char *id;
+                const char *key;
+                char       *id;
                 char       *name;
                 char       *comment;
 
@@ -185,6 +186,7 @@ gdm_recent_option_widget_sync_items_from
 
                         g_free (name);
                         g_free (comment);
+                        g_free (id);
                 }
         }
 
Index: gdm-2.24.0/gui/simple-greeter/gdm-recent-option-widget.h
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-recent-option-widget.h
+++ gdm-2.24.0/gui/simple-greeter/gdm-recent-option-widget.h
@@ -48,10 +48,10 @@ typedef struct
         GdmOptionWidgetClass       parent_class;
 } GdmRecentOptionWidgetClass;
 
-typedef gboolean (* GdmRecentOptionLookupItemFunc) (GdmRecentOptionWidget  *widget,
-                                                    const char             *id,
-                                                    char                  **name,
-                                                    char                  **comment);
+typedef char * (* GdmRecentOptionLookupItemFunc) (GdmRecentOptionWidget  *widget,
+                                                  const char             *key,
+                                                  char                  **name,
+                                                  char                  **comment);
 
 
 GType                  gdm_recent_option_widget_get_type               (void);
