[gnome-commander/gcmd-1-2-8] GnomeCmdFileList: fix for sort_by_dir() function
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-2-8] GnomeCmdFileList: fix for sort_by_dir() function
- Date: Fri, 6 Jan 2012 19:17:27 +0000 (UTC)
commit f5a58a57f25ae804be29b7166c5989b9e3b0fe01
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Fri Jan 6 20:16:33 2012 +0100
GnomeCmdFileList: fix for sort_by_dir() function
src/gnome-cmd-file-list.cc | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 4b1bf1d..b758960 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -867,22 +867,23 @@ static gint sort_by_dir (GnomeCmdFile *f1, GnomeCmdFile *f2, GnomeCmdFileList *f
if (f1->info->type < f2->info->type)
return 1;
- // gchar *t1 = gnome_cmd_file_get_path (f1);
- // gchar *t2 = gnome_cmd_file_get_path (f2);
- // gchar *d1 = g_path_get_dirname (t1);
- // gchar *d2 = g_path_get_dirname (t2);
-
gboolean raising = fl->priv->sort_raising[fl->priv->current_col];
- // gint ret = my_strcmp (d1, d2, raising);
+ gchar *t1 = gnome_cmd_file_get_path (f1);
+ gchar *t2 = gnome_cmd_file_get_path (f2);
+ gchar *d1 = g_path_get_dirname (t1);
+ gchar *d2 = g_path_get_dirname (t2);
- // g_free (t1);
- // g_free (t2);
- // g_free (d1);
- // g_free (d2);
+ gint ret = my_strcmp (d1, d2, raising);
- // return ret;
+ g_free (t1);
+ g_free (t2);
+ g_free (d1);
+ g_free (d2);
- return my_strcmp (gnome_cmd_file_get_collation_fname (f1), gnome_cmd_file_get_collation_fname (f2), raising);
+ if (!ret)
+ ret = my_strcmp (gnome_cmd_file_get_collation_fname (f1), gnome_cmd_file_get_collation_fname (f2), raising);
+
+ return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]