[gdm] Fix to sort language names instead of pango lang tag. Bug #593359



commit ea73f08f576abc65f1e3558465c66b277621be47
Author: Takao Fujiwara <tfujiwar redhat com>
Date:   Thu Sep 17 10:36:25 2009 +0900

    Fix to sort language names instead of pango lang tag. Bug #593359
    
    Reviewed by Ray Strode

 gui/simple-greeter/gdm-chooser-widget.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index f3aa58b..2875456 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -1411,6 +1411,8 @@ compare_item  (GtkTreeModel *model,
         GdmChooserWidget *widget;
         char             *name_a;
         char             *name_b;
+        char             *text_a;
+        char             *text_b;
         gulong            prio_a;
         gulong            prio_b;
         gboolean          is_separate_a;
@@ -1419,6 +1421,7 @@ compare_item  (GtkTreeModel *model,
         int               direction;
         GtkTreeIter      *separator_iter;
         char             *id;
+        PangoAttrList    *attrs;
 
         g_assert (GDM_IS_CHOOSER_WIDGET (data));
 
@@ -1478,7 +1481,14 @@ compare_item  (GtkTreeModel *model,
                 result *= direction;
         } else if (is_separate_b == is_separate_a) {
                 if (prio_a == prio_b) {
-                        result = g_utf8_collate (name_a, name_b);
+                        pango_parse_markup (name_a, -1, 0, &attrs, &text_a, NULL, NULL);
+                        pango_parse_markup (name_b, -1, 0, &attrs, &text_b, NULL, NULL);
+                        if (text_a && text_b)
+                            result = g_utf8_collate (text_a, text_b);
+                        else
+                            result = g_utf8_collate (name_a, name_b);
+                        g_free (text_a);
+                        g_free (text_b);
                 } else if (prio_a > prio_b) {
                         result = -1;
                 } else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]