GNOME Bugzilla – Bug 147813
gnome_vfs_volume_compare, gnome_vfs_drive_compare shouldn't use strcmp()
Last modified: 2006-04-25 12:04:54 UTC
Currently, the drive/volume lists of the vfs monitor aren't sorted at all, for instance resulting in the drive order "CD-ROM", "Floppy", "CD-ROM (2)" inside the filechooser. IMHO, we ought to sort these. Pretty trivial since it boils down to glist magic. regs, Chris
Created attachment 29624 [details] [review] Proposed patch against HEAD. NULL paranoia.
Any news?
Maybe you should post that on nautilus-list as well ;-) It looks like it speeds things up a lot.
gnome-vfs list rather for gnome-vfs bugs :)
Yeah I didnt think of that - since Alex is the maintainer for both and the problem shows up in nautilus I figured it would help :p
What's happening with this?
Created attachment 60579 [details] [review] New patch The last one was really crappy.
If anything we should sort by gnome_vfs_volume_compare / gnome_vfs_drive_compare. Nautilus already does this by itself in the views. But i don't think keeping the source lists sorted is the best way to handle it, because they get concatenated in e.g. gnome_vfs_volume_monitor_get_mounted_volumes() so the sort can only move within sublists. Either we should sort in gnome_vfs_volume_monitor_get_mounted_volumes, or in the app, and since some apps don't need to get a sorted list from get_mounted_volumes i think this make much better sense to do in the app.
I'm updating this bug report. The problem with the solution proposed in comment 8 is that the drive/volume comparison uses strcmp() instead of casefolding and using collation keys. Thus, the comparison is not case-insensitive and doesn't work properly unless you use ASCII.
Created attachment 62521 [details] [review] Proposed drive/volume comparison patch Discussion: http://mail.gnome.org/archives/gnome-vfs-list/2006-April/msg00000.html
Marking bug 321320 as dependant on this one.
*** Bug 155248 has been marked as a duplicate of this bug. ***
patch for bug #321320 is commited and this bug depend on the patch proposed here... can we commit the proposed patch for _compare() ?
A patch very similar to attachment 62521 [details] [review] was committed (just with one function invocation fix). GnomeVFS 2.14.2 should sort volumes/drives correctly.