[gnome-commander] Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-commander] Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)
- Date: Fri, 30 Oct 2009 21:35:43 +0000 (UTC)
commit b44e26f869c53aa3011dc6af24dc9822bb3e2a2d
Author: Marcin Wider <mwider gmail com>
Date: Fri Oct 30 22:20:03 2009 +0100
Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)
NEWS | 2 +-
doc/C/gnome-commander.xml | 2 +-
src/gnome-cmd-file-list.cc | 14 +++++++++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index cc4cae9..155f134 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ gnome-commander 1.2.8.4
---------------
Bug fixes:
- * ...
+ * Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)
===================================
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index 5554182..b9e3605 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6028,7 +6028,7 @@
<para>
<itemizedlist>
<listitem>
- <para>...</para>
+ <para>Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)</para>
</listitem>
</itemizedlist>
</para>
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index c32377c..5a64997 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -821,6 +821,18 @@ inline gint my_intcmp (gint i1, gint i2, gboolean raising)
}
+inline gint my_filesizecmp (GnomeVFSFileSize i1, GnomeVFSFileSize i2, gboolean raising)
+{
+ if (i1 > i2)
+ return raising ? -1 : 1;
+
+ if (i2 > i1)
+ return raising ? 1 : -1;
+
+ return 0;
+}
+
+
static gint sort_by_name (GnomeCmdFile *f1, GnomeCmdFile *f2, GnomeCmdFileList *fl)
{
if (strcmp (f1->info->name, "..") == 0)
@@ -919,7 +931,7 @@ static gint sort_by_size (GnomeCmdFile *f1, GnomeCmdFile *f2, GnomeCmdFileList *
if (!ret)
{
- ret = my_intcmp (f1->info->size, f2->info->size, raising);
+ ret = my_filesizecmp (f1->info->size, f2->info->size, raising);
if (!ret)
ret = my_strcmp (gnome_cmd_file_get_collation_fname (f1), gnome_cmd_file_get_collation_fname (f2), file_raising);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]