e1ea6b9
diff -up gdm-2.23.92/gui/simple-greeter/gdm-language-option-widget.c.filter-dupes-from-lang-list gdm-2.23.92/gui/simple-greeter/gdm-language-option-widget.c
e1ea6b9
--- gdm-2.23.92/gui/simple-greeter/gdm-language-option-widget.c.filter-dupes-from-lang-list	2008-08-26 15:04:00.000000000 -0400
e1ea6b9
+++ gdm-2.23.92/gui/simple-greeter/gdm-language-option-widget.c	2008-09-17 11:07:51.000000000 -0400
e1ea6b9
@@ -173,7 +173,7 @@ gdm_language_option_widget_class_init (G
e1ea6b9
         g_type_class_add_private (klass, sizeof (GdmLanguageOptionWidgetPrivate));
e1ea6b9
 }
e1ea6b9
 
e1ea6b9
-static gboolean
e1ea6b9
+static char *
e1ea6b9
 gdm_language_option_widget_lookup_item (GdmRecentOptionWidget *widget,
e1ea6b9
                                         const char            *locale,
e1ea6b9
                                         char                 **name,
e1ea6b9
@@ -182,11 +182,15 @@ gdm_language_option_widget_lookup_item (
e1ea6b9
         char *language;
e1ea6b9
         char *readable_language;
e1ea6b9
         char *lang_tag;
e1ea6b9
+        char *normalized_locale;
e1ea6b9
 
e1ea6b9
-        language = gdm_get_language_from_name (locale, locale);
e1ea6b9
+        normalized_locale = gdm_normalize_language_name (locale);
e1ea6b9
+
e1ea6b9
+        language = gdm_get_language_from_name (locale, normalized_locale);
e1ea6b9
 
e1ea6b9
         if (language == NULL) {
e1ea6b9
-                return FALSE;
e1ea6b9
+                g_free (normalized_locale);
e1ea6b9
+                return NULL;
e1ea6b9
         }
e1ea6b9
 
e1ea6b9
         readable_language = gdm_get_language_from_name (locale, NULL);
e1ea6b9
@@ -197,7 +201,7 @@ gdm_language_option_widget_lookup_item (
e1ea6b9
         g_free (language);
e1ea6b9
         g_free (lang_tag);
e1ea6b9
 
e1ea6b9
-        return TRUE;
e1ea6b9
+        return normalized_locale;
e1ea6b9
 }
e1ea6b9
 
e1ea6b9
 static void
e1ea6b9
@@ -294,7 +298,7 @@ gdm_language_option_widget_set_current_l
e1ea6b9
 
e1ea6b9
         if (normalized_language_name != NULL &&
e1ea6b9
             !gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget),
e1ea6b9
-                                            normalized_language_name, NULL, NULL, NULL)) {
e1ea6b9
+                                            &normalized_language_name, NULL, NULL, NULL)) {
e1ea6b9
                 gdm_recent_option_widget_add_item (GDM_RECENT_OPTION_WIDGET (widget),
e1ea6b9
                                                    normalized_language_name);
e1ea6b9
         }
e1ea6b9
diff -up gdm-2.23.92/gui/simple-greeter/gdm-layout-option-widget.c.filter-dupes-from-lang-list gdm-2.23.92/gui/simple-greeter/gdm-layout-option-widget.c
e1ea6b9
--- gdm-2.23.92/gui/simple-greeter/gdm-layout-option-widget.c.filter-dupes-from-lang-list	2008-09-17 10:55:20.000000000 -0400
e1ea6b9
+++ gdm-2.23.92/gui/simple-greeter/gdm-layout-option-widget.c	2008-09-17 11:08:07.000000000 -0400
e1ea6b9
@@ -176,24 +176,24 @@ gdm_layout_option_widget_class_init (Gdm
e1ea6b9
         g_type_class_add_private (klass, sizeof (GdmLayoutOptionWidgetPrivate));
e1ea6b9
 }
e1ea6b9
 
e1ea6b9
-static gboolean
e1ea6b9
+static char *
e1ea6b9
 gdm_layout_option_widget_lookup_item (GdmRecentOptionWidget *widget,
e1ea6b9
-                                      const char            *id,
e1ea6b9
+                                      const char            *key,
e1ea6b9
                                       char                 **name,
e1ea6b9
                                       char                 **comment)
e1ea6b9
 {
e1ea6b9
         char *layout;
e1ea6b9
 
e1ea6b9
-        layout = gdm_get_layout_from_name (id);
e1ea6b9
+        layout = gdm_get_layout_from_name (key);
e1ea6b9
 
e1ea6b9
         if (layout == NULL) {
e1ea6b9
-                return FALSE;
e1ea6b9
+                return NULL;
e1ea6b9
         }
e1ea6b9
 
e1ea6b9
         *name = layout;
e1ea6b9
         *comment = NULL;
e1ea6b9
 
e1ea6b9
-        return TRUE;
e1ea6b9
+        return g_strdup (key);
e1ea6b9
 }
e1ea6b9
 
e1ea6b9
 static void
e1ea6b9
diff -up gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.c.filter-dupes-from-lang-list gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.c
e1ea6b9
--- gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.c.filter-dupes-from-lang-list	2008-08-26 15:04:00.000000000 -0400
e1ea6b9
+++ gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.c	2008-09-17 11:06:34.000000000 -0400
e1ea6b9
@@ -159,13 +159,24 @@ gdm_recent_option_widget_sync_items_from
e1ea6b9
         default_is_set = FALSE;
e1ea6b9
 
e1ea6b9
         for (tmp = list; tmp != NULL; tmp = tmp->next) {
e1ea6b9
-                const char *id;
e1ea6b9
+                const char *key;
e1ea6b9
+                char       *id;
e1ea6b9
                 char       *name;
e1ea6b9
                 char       *comment;
e1ea6b9
 
e1ea6b9
-                id = (char *) tmp->data;
e1ea6b9
+                key = (char *) tmp->data;
e1ea6b9
+
e1ea6b9
+                id = widget->priv->lookup_item_func (widget, key, &name, &comment);
e1ea6b9
+
e1ea6b9
+                if (id != NULL) {
e1ea6b9
+                        gboolean item_exists;
e1ea6b9
+
e1ea6b9
+                        item_exists = gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget), id, NULL, NULL, NULL);
e1ea6b9
+
e1ea6b9
+                        if (item_exists) {
e1ea6b9
+                                continue;
e1ea6b9
+                        }
e1ea6b9
 
e1ea6b9
-                if (widget->priv->lookup_item_func (widget, id, &name, &comment)) {
e1ea6b9
                         gdm_option_widget_add_item (GDM_OPTION_WIDGET (widget),
e1ea6b9
                                                     id, name, comment,
e1ea6b9
                                                     GDM_OPTION_WIDGET_POSITION_MIDDLE);
e1ea6b9
@@ -177,6 +188,7 @@ gdm_recent_option_widget_sync_items_from
e1ea6b9
 
e1ea6b9
                         g_free (name);
e1ea6b9
                         g_free (comment);
e1ea6b9
+                        g_free (id);
e1ea6b9
                 }
e1ea6b9
         }
e1ea6b9
 
e1ea6b9
diff -up gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.h.filter-dupes-from-lang-list gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.h
e1ea6b9
--- gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.h.filter-dupes-from-lang-list	2008-08-26 15:04:00.000000000 -0400
e1ea6b9
+++ gdm-2.23.92/gui/simple-greeter/gdm-recent-option-widget.h	2008-09-17 11:07:40.000000000 -0400
e1ea6b9
@@ -48,10 +48,10 @@ typedef struct
e1ea6b9
         GdmOptionWidgetClass       parent_class;
e1ea6b9
 } GdmRecentOptionWidgetClass;
e1ea6b9
 
e1ea6b9
-typedef gboolean (* GdmRecentOptionLookupItemFunc) (GdmRecentOptionWidget  *widget,
e1ea6b9
-                                                    const char             *id,
e1ea6b9
-                                                    char                  **name,
e1ea6b9
-                                                    char                  **comment);
e1ea6b9
+typedef char * (* GdmRecentOptionLookupItemFunc) (GdmRecentOptionWidget  *widget,
e1ea6b9
+                                                  const char             *key,
e1ea6b9
+                                                  char                  **name,
e1ea6b9
+                                                  char                  **comment);
e1ea6b9
 
e1ea6b9
 
e1ea6b9
 GType                  gdm_recent_option_widget_get_type               (void);