[patch] Bug 88585, Sorting of size column is messed up



Hi,

this simple patch fixes the ascending and descending sort orders
being reversed for the size column in the Nautilus list view.
With this patch the size column behavior is consistent with the
other columns.

Tomas Junnonen
Index: nautilus-file.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file.c,v
retrieving revision 1.303
diff -u -r1.303 nautilus-file.c
--- nautilus-file.c	18 Oct 2002 15:47:28 -0000	1.303
+++ nautilus-file.c	2 Nov 2002 19:15:25 -0000
@@ -1481,10 +1481,10 @@
 compare_directories_by_count (NautilusFile *file_1, NautilusFile *file_2)
 {
 	/* Sort order:
-	 *   Directories with n items
-	 *   Directories with 0 items
-	 *   Directories with "unknowable" # of items
 	 *   Directories with unknown # of items
+	 *   Directories with "unknowable" # of items
+	 *   Directories with 0 items
+	 *   Directories with n items
 	 */
 
 	Knowledge count_known_1, count_known_2;
@@ -1493,17 +1493,17 @@
 	count_known_1 = get_item_count (file_1, &count_1);
 	count_known_2 = get_item_count (file_2, &count_2);
 
-	if (count_known_1 < count_known_2) {
+	if (count_known_1 > count_known_2) {
 		return -1;
 	}
-	if (count_known_1 > count_known_2) {
+	if (count_known_1 < count_known_2) {
 		return +1;
 	}
 
-	if (count_1 > count_2) {
+	if (count_1 < count_2) {
 		return -1;
 	}
-	if (count_1 < count_2) {
+	if (count_1 > count_2) {
 		return +1;
 	}
 
@@ -1514,10 +1514,10 @@
 compare_files_by_size (NautilusFile *file_1, NautilusFile *file_2)
 {
 	/* Sort order:
-	 *   Files with large sizes.
-	 *   Files with smaller sizes.
-	 *   Files with "unknowable" size.
 	 *   Files with unknown size.
+	 *   Files with "unknowable" size.
+	 *   Files with smaller sizes.
+	 *   Files with large sizes.
 	 */
 
 	Knowledge size_known_1, size_known_2;
@@ -1526,17 +1526,17 @@
 	size_known_1 = get_size (file_1, &size_1);
 	size_known_2 = get_size (file_2, &size_2);
 
-	if (size_known_1 < size_known_2) {
+	if (size_known_1 > size_known_2) {
 		return -1;
 	}
-	if (size_known_1 > size_known_2) {
+	if (size_known_1 < size_known_2) {
 		return +1;
 	}
 
-	if (size_1 > size_2) {
+	if (size_1 < size_2) {
 		return -1;
 	}
-	if (size_1 < size_2) {
+	if (size_1 > size_2) {
 		return +1;
 	}
 


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