Bug 416025 - Sorting by name takes the dot of file extension into account when sorting files
Summary: Sorting by name takes the dot of file extension into account when sorting files
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 19.12.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-08 21:21 UTC by Riccardo Robecchi
Modified: 2023-05-23 11:00 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
File sorting example (69.69 KB, image/png)
2020-01-08 21:21 UTC, Riccardo Robecchi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Robecchi 2020-01-08 21:21:05 UTC
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
Comment 1 Julian Steinmann 2020-01-10 20:22:41 UTC
Can confirm this behavior. Change proposed does seem sensible.
Comment 2 php4fan 2023-01-11 16:17:42 UTC
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.
Comment 3 mudo_jacal 2023-05-23 11:00:04 UTC
I agree, this way of sorting is unique and can be slightly annoying.