Bug 498346 - Starting from 24.11.90 and up, Dolphin sorts files with parentheses in filenames last, not first
Summary: Starting from 24.11.90 and up, Dolphin sorts files with parentheses in filena...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.11.90
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-01-07 08:21 UTC by Dmitry Berdnikov
Modified: 2025-01-12 21:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshots of sorting behavior (33.45 KB, application/x-xz)
2025-01-07 08:21 UTC, Dmitry Berdnikov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Berdnikov 2025-01-07 08:21:39 UTC
Created attachment 177156 [details]
Screenshots of sorting behavior

SUMMARY
Starting from 24.11.90 and up, Dolphin sorts files with parentheses in filenames last, which is at least not how I'm expecting Dolphin to behave, neither this is the way the files are sorted by my image viewer of choice (qView 6.1) or my shell (bash 5.2.37).

This bug is really screwing up with me, with the way that I'm used to my personal file naming convention.

I've tried my best to describe the bug with the template here, but I also attached an archive with a couple of screenshots across different versions of Dolphin (24.11.80 and 24.12.00, which is the latest stable release).

STEPS TO REPRODUCE
1. Rename an existing couple of files/make new ones and name them in such a way, where one of them contains round brackets at the end (either with something within them or empty).
2. Observe that the file with round brackets is sorted last, not first.
2b. ls command within the same directory should show shell sorting file with round brackets first, not last.
3. Downgrade to 24.11.80 and observe that the problem is gone.

OBSERVED RESULT
File with parentheses in filename is sorted last.

EXPECTED RESULT
File with parentheses in filename should be sorted first.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Comment 1 Felix Ernst 2025-01-08 23:38:20 UTC
The only change to sorting I remember happening in Dolphin in recent month is https://invent.kde.org/system/dolphin/-/commit/e4cc6e69430049366434e3383b1d2ef283ed22cc. I haven't tested if this really is the cause, but it might be the reason for this unexpected behaviour change.
Comment 2 fanzhuyifan 2025-01-12 20:15:48 UTC
For me if I create the files 321 and 321(), ls sorts 321 in front of 321(). This is consistent with ls sorting 3 in front of 321. Are you sure you are using the default alphabetical sort of ls?
Comment 3 Dmitry Berdnikov 2025-01-12 21:45:30 UTC
(In reply to fanzhuyifan from comment #2)
> For me if I create the files 321 and 321(), ls sorts 321 in front of 321().
> This is consistent with ls sorting 3 in front of 321. Are you sure you are
> using the default alphabetical sort of ls?

First of all, thank you for this comment.

Second, I recreated this and ls sorts the files for me consistently with how you described. I'm not sure what you've meant by asking this because I run ls without any flags, and on my system I don't have any scripts or anything that changes that for me automatically, ls on my system sorts files alphabetically as by default. Alas, that is NOT the problem here. In any version past 24.11.90, with sorting mode selected being "Natural", Dolphin sorts files with round brackets in the filename after files with the same name without those, and I expected Dolphin to do exactly that. But it doesn't.

Third, on that note I would like to add that thanks to you I noticed that files without a file extension (or without just a single period at the very end for that matter) are not affected by this. They are ALWAYS sorted just like ls command sorts them.
Comment 4 Dmitry Berdnikov 2025-01-12 21:48:57 UTC
(In reply to Dmitry Berdnikov from comment #3)
> In any version past 24.11.90, with sorting mode selected being "Natural", Dolphin
> sorts files with round brackets in the filename after files with the same
> name without those, and I expected Dolphin to do exactly that. But it
> doesn't.

Scratch that. I meant before, not after. Bummer.
Comment 5 fanzhuyifan 2025-01-12 21:58:11 UTC
I made that comment because on my end (dolphin 24.12.1), sorting in dolphin by name gives exactly the same order as ls:

1.txt
1().txt
321
321()

So I am not sure I understand what exactly is the bug being reported here.

You also mentioned that
> 2b. ls command within the same directory should show shell sorting file with round brackets first, not last.

which is different from the behavior of ls that I am observing (round brackets go last).