gnome-commander r2496 - in branches/gcmd-1-3: . doc/C src



Author: epiotr
Date: Fri Mar 27 17:42:41 2009
New Revision: 2496
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2496&view=rev

Log:
Fixed problem #576174 (case insensitive file name sorting in non en_US.utf8 locale)

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/NEWS
   branches/gcmd-1-3/doc/C/gnome-commander.xml
   branches/gcmd-1-3/src/gnome-cmd-file-list.cc
   branches/gcmd-1-3/src/gnome-cmd-file.cc

Modified: branches/gcmd-1-3/NEWS
==============================================================================
--- branches/gcmd-1-3/NEWS	(original)
+++ branches/gcmd-1-3/NEWS	Fri Mar 27 17:42:41 2009
@@ -16,6 +16,7 @@
  * Fixed problem #571239 (replacing obsoleted GnomeColorPicker with GtkColorButton)
  * Fixed problem #571247 (replacing obsoleted GnomePixmap with GtkImage)
  * Fixed problem #571558 (replacing deprecated GNOME_STOCK_* buttons with GTK_STOCK_* counterparts)
+ * Fixed problem #576174 (case insensitive file name sorting in non en_US.utf8 locale)
  * Fixed problem with setting equal pane size in horizontal mode
 
 New features:

Modified: branches/gcmd-1-3/doc/C/gnome-commander.xml
==============================================================================
--- branches/gcmd-1-3/doc/C/gnome-commander.xml	(original)
+++ branches/gcmd-1-3/doc/C/gnome-commander.xml	Fri Mar 27 17:42:41 2009
@@ -5910,6 +5910,9 @@
                             <para>Fixed problem #571558 (replacing deprecated GNOME_STOCK_* buttons with GTK_STOCK_* counterparts)</para>
                         </listitem>
                         <listitem>
+                            <para>Fixed problem #576174 (case insensitive file name sorting in non en_US.utf8 locale)</para>
+                        </listitem>
+                        <listitem>
                             <para>Fixed problem with setting equal pane size in horizontal mode</para>
                         </listitem>
                     </itemizedlist>

Modified: branches/gcmd-1-3/src/gnome-cmd-file-list.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-list.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-list.cc	Fri Mar 27 17:42:41 2009
@@ -745,17 +745,12 @@
 
 
 /******************************************************
- * Filesorting functions
+ * File sorting functions
  **/
 
 inline gint my_strcmp (const gchar *s1, const gchar *s2, gboolean raising)
 {
-    int ret = 0;
-
-    if (gnome_cmd_data.case_sens_sort)
-        ret = strcmp (s1,s2);
-    else
-        ret = g_strcasecmp (s1,s2);
+    int ret = strcmp (s1, s2);
 
     if (ret > 0)
         return raising ? -1 : 1;

Modified: branches/gcmd-1-3/src/gnome-cmd-file.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file.cc	Fri Mar 27 17:42:41 2009
@@ -214,7 +214,17 @@
     f->info = info;
     GNOME_CMD_FILE_INFO (f)->info = info;
 
-    gchar *utf8_name = get_utf8 (info->name);
+    gchar *utf8_name;
+
+    if (!gnome_cmd_data.case_sens_sort)
+    {
+        gchar *s = get_utf8 (info->name);
+        utf8_name = g_utf8_casefold (s, -1);
+        g_free (s);
+    }
+    else
+        utf8_name = get_utf8 (info->name);
+
     f->collate_key = g_utf8_collate_key_for_filename (utf8_name, -1);
     g_free (utf8_name);
 
@@ -826,7 +836,17 @@
     gnome_vfs_file_info_ref (info);
     f->info = info;
 
-    gchar *utf8_name = get_utf8 (info->name);
+    gchar *utf8_name;
+
+    if (!gnome_cmd_data.case_sens_sort)
+    {
+        gchar *s = get_utf8 (info->name);
+        utf8_name = g_utf8_casefold (s, -1);
+        g_free (s);
+    }
+    else
+        utf8_name = get_utf8 (info->name);
+
     f->collate_key = g_utf8_collate_key_for_filename (utf8_name, -1);
     g_free (utf8_name);
 }



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