[gnome-commander/gcmd-1-2-8] 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/gcmd-1-2-8] Fixed Ubuntu problem #369818 (incorrect sorting by size in panel)
- Date: Fri, 30 Oct 2009 21:35:28 +0000 (UTC)
commit e4e6cde02a921cd9c138314798f94cfcff9f3dc3
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 54c1362..dfd869a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,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 e8dde18..4002b99 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6012,7 +6012,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 1d453d8..f172882 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -775,6 +775,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)
@@ -873,7 +885,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]