Bug 494875

Summary: Dolphin sort by name sorts numbers first by first number
Product: [Applications] dolphin Reporter: ostap-tymur-tymchenko <ostap.tymchenko>
Component: panels: foldersAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: minor CC: dolphin-bugs-null, kdedev
Priority: NOR    
Version First Reported In: 24.05.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: An screenshot of the observed behavior

Description ostap-tymur-tymchenko 2024-10-16 15:40:06 UTC
Created attachment 174897 [details]
An screenshot of the observed behavior

SUMMARY
Dolphin sort by name sorts numbers incorrectly

when sorting a list like:
File 1
File 2
...
File 10

It should sort like:
File 1, File 2, File 3...

Instead it is sorted like:

File 1
File 10
File 11
File 12
...
File 2

STEPS TO REPRODUCE
1.  Make x files by cd'ing into a tmp dir and executing 'touch File "{1..20}.txt`
2.  Go there in dolphin and sort by Name, A-Z

OBSERVED RESULT
File sort list is:
File 1, File 10, File 11 etc.

EXPECTED RESULT
File sort list is:
File 1, File 2, File 3 etc.

SOFTWARE/OS VERSIONS
Operating System: Nobara Linux 39
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.6.2
Kernel Version: 6.8.12-200.fsync.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7640U w/ Radeon 760M Graphics
Memory: 14.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A5

ADDITIONAL INFORMATION
I have attached a screenshot of the observed behavior.
Comment 1 TraceyC 2024-10-21 19:31:00 UTC
You can change the way Dolphin sorts files to the way you want in the settings.
Settings - Configure Dolphin -View - Content Display
For "Sorting mode" choose "Natural" and restart Dolphin. I confirmed that shows the files in order as
File 1.txt
File 2.txt
etc.

As an aside, the command you wrote doesn't work as typed, it has mismatched quoting. This works:
touch File\ {1..20}.txt

Keep in mind that Plasma and KDE apps are very flexible. If you want to change behavior, there's usually a setting. :)