! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use natural order for sorting in directory menu
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Directory Menu

Comments

Description Simeon 2019-05-18 21:59:32 CEST
Currently filenames in the directory menu are sorted alphabetically, e.g.,

file1
file23
file3

as opposed to naturally:

file1
file3
file23

This is inconsistent with Thunar, which takes the latter approach. Indeed for filename sorting, the second order makes more sense.

This can easily be fixed by modifying "directory_menu_plugin_menu_sort" in "root/plugins/directorymenu/directorymenu.c" to use "g_utf8_collate_key_for_filename()" instead of "g_utf8_collate()".
Comment 1 Simon Steinbeiss editbugs 2019-07-15 00:48:41 CEST
I agree it would be nice to have a consistent experience between Thunar and the directory menu.
Would you be interested in trying to provide a patch?
Comment 2 Simeon 2019-07-15 03:39:17 CEST
Created attachment 8773 
Use natural order for sorting in directory menu
Comment 3 Simon Steinbeiss editbugs 2019-07-15 22:54:49 CEST
Created attachment 8775 
Patch for the initial patch

Wow, that was quick. Your patch works fine, however as far as I can tell it leaks.
From the docs of g_utf8_collate_key_for_filename():
"Returns: a newly allocated string. This string should be freed with g_free() when you are done with it."

Please review my patch for your patch. Thanks!
Comment 4 Simeon 2019-07-16 00:33:48 CEST
Whoops, I guess I missed out that part.

Your patch looks good. Thanks.
Comment 5 Git Bot editbugs 2019-07-16 00:47:54 CEST
Simeon Krastnikov referenced this bugreport in commit d1edf285db6af76cb1c4ef8b0313748449aa6a6d

directory-menu: Use natural order for sorting (Bug #15413)

https://git.xfce.org/xfce/xfce4-panel/commit?id=d1edf285db6af76cb1c4ef8b0313748449aa6a6d
Comment 6 Simon Steinbeiss editbugs 2019-07-16 00:48:40 CEST
Alrighty, squashed the two commits into one.
Thanks for reporting a bug and working out the fix!

Bug #15413

Reported by:
Simeon
Reported on: 2019-05-18
Last modified on: 2019-07-16

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Version:
4.12.2

Attachments

Additional information