Hi,
the "#" column in the search results GUI normally is a low-cardinality
column with an exponential distribution (most files have a count of 1,
fewer have 2, even fewer have 3, etc.) Currently, when sorting by #,
the entries within the same # value are unsorted. I have attached a
patch that sorts by file size as the secondary key when sorting by #.
This works fine with GTK1. I don't know if another patch is required
for GTK2 or if the GTK2 code uses the same sorting functions as GTK1.
Greetings,
Thomas.
Index: search_gui.c
===================================================================
RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/search_gui.c,v
retrieving revision 1.93
diff -u -r1.93 search_gui.c
--- search_gui.c 18 Apr 2004 15:06:59 -0000 1.93
+++ search_gui.c 10 May 2004 08:31:55 -0000
@@ -562,8 +562,12 @@
break;
case c_sr_count:
+ /*
+ * Sort by count, then by size
+ */
if (g1->num_children == g2->num_children)
- result = 0;
+ result = (r1->size == r2->size) ? 0 :
+ ((r1->size > r2->size) ? +1 : -1);
else
result = (g1->num_children > g2->num_children)
? +1 : -1;
break;