LWN.net Logo

Do the actually not like their users?

Do the actually not like their users?

Posted Apr 24, 2008 6:20 UTC (Thu) by allesfresser (subscriber, #216)
In reply to: Do the actually not like their users? by tjc
Parent article: The Grumpy Editor encounters the Hardy Heron

I would definitely agree with that comment, especially in my own pet-peeve case: file-selector
widget sorting.  GTK/Gnome has the setting to sort folders separately from files fixed in
stone (well, in the source code, but it might as well be in granite), with a snarky little
comment about how this is the One True Way and it will Always Be That Way.  Fortunately, a
little snip-snip with the editor, and a recompile, and the One True Way disappears into the
ether.  :)  When I say I want things sorted by last-modified date, that's exactly what I mean,
d*** it.  It doesn't matter that the last-modified thing is a folder or not--whatever it is,
put it at the top (or the bottom, if the sort is reversed)!


(Log in to post comments)

Do the actually not like their users?

Posted Apr 24, 2008 7:59 UTC (Thu) by debacle (subscriber, #7114) [Link]

Could you please post, where I have to change this? Patch or filename+number would be OK. TIA.

Do the actually not like their users?

Posted Apr 24, 2008 16:53 UTC (Thu) by allesfresser (subscriber, #216) [Link]

When I patched it out before, it was lines 5644 to 5707 of
gtk+-2.10.14/gtk/gtkfilechooserdefault.c.  You'll probably be able to see what to cut out and
rearrange (essentially, remove the COMPARE_DIRECTORIES macro calls).  I'm grabbing 2.12.9
right now, and I'll see if it's the same way--if so, I'll post a diff.

Do the actually not like their users?

Posted Apr 24, 2008 17:04 UTC (Thu) by allesfresser (subscriber, #216) [Link]

It is still the same in 2.12.9. Following is a patch. I didn't choose to remove the definition for the COMPARE_DIRECTORIES macro, because it won't make any difference in the generated code, but you can take it out if you want to be extra-neat.

--- gtk+-2.12.9-orig/gtk/gtkfilechooserdefault.c	2008-04-24 09:57:46.000000000 -0700
+++ gtk+-2.12.9-modified/gtk/gtkfilechooserdefault.c	2008-04-24 09:59:23.000000000 -0700
@@ -6278,8 +6278,6 @@
 		GtkTreeIter  *b,
 		gpointer      user_data)
 {
-  COMPARE_DIRECTORIES;
-  else
     return strcmp (gtk_file_info_get_display_key (info_a), gtk_file_info_get_display_key (info_b));
 }
 
@@ -6290,14 +6288,10 @@
 		GtkTreeIter  *b,
 		gpointer      user_data)
 {
-  COMPARE_DIRECTORIES;
-  else
-    {
       gint64 size_a = gtk_file_info_get_size (info_a);
       gint64 size_b = gtk_file_info_get_size (info_b);
 
       return size_a > size_b ? -1 : (size_a == size_b ? 0 : 1);
-    }
 }
 
 /* Sort callback for the mtime column */
@@ -6307,14 +6301,10 @@
 		 GtkTreeIter  *b,
 		 gpointer      user_data)
 {
-  COMPARE_DIRECTORIES;
-  else
-    {
       GtkFileTime ta = gtk_file_info_get_modification_time (info_a);
       GtkFileTime tb = gtk_file_info_get_modification_time (info_b);
 
       return ta > tb ? -1 : (ta == tb ? 0 : 1);
-    }
 }
 
 /* Callback used when the sort column changes.  We cache the sort order for use

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds