Created attachment 124982 [details] File sorting example SUMMARY The current implementation of natural sorting takes the dot of the file extension into account, and this makes it so that files with numbers in their name are shown before those with the same name but without numbers. It seems like the dot of the extension is treated as part of the file name; while it is indeed part of the file name in UNIX-like OSes due to magic numbers, from a user perspective this is unintuitive as we humans treat the file name and the extension as two separate things, with the dot acting as the separator. STEPS TO REPRODUCE 1. create three files: "file.txt", "file 2.txt", "file 3.txt"; 2. use sorting by name. OBSERVED RESULT The files are shown in the following order: "file 2.txt", "file 3.txt", "file.txt". EXPECTED RESULT The files should be sorted in what we might call a "natural" way: files with a space and a number following their name should come after those without space and number in their file name. This behaviour is seen in all other desktop environments (e.g. GNOME) and operating systems (e.g. Windows). SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE neon KDE Plasma Version: 5.17.4 KDE Frameworks Version: 5.65.0 Qt Version: 5.13.2 ADDITIONAL INFORMATION
Can confirm this behavior. Change proposed does seem sensible.
This is not just a sensible change proposal, this is a bug. Sorting file names like this is just wrong, there's no argument in favor of it (unless you can make one) and I've never seen file names being sorted like this anywhere outside of KDE. Even those pieces of software that are as non-smart as to put all uppercase letters before all lowercase letters, correctly put the dot before most other characters. Actually I think this is a regression and it used to behave correctly, but here I could be confused and it could just be when I started using KDE.
I agree, this way of sorting is unique and can be slightly annoying.