Bug 406296 - [Dolphin] Inconsistent sort order
Summary: [Dolphin] Inconsistent sort order
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 18.04.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
Keywords: junior-jobs
Depends on:
Reported: 2019-04-07 12:11 UTC by Holger
Modified: 2020-01-28 22:49 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.04.0

screenshot inconsitent sort order (156.17 KB, image/png)
2019-04-07 12:11 UTC, Holger

Note You need to log in before you can comment on or make changes to this bug.
Description Holger 2019-04-07 12:11:48 UTC
Created attachment 119282 [details]
screenshot inconsitent sort order


None of the available sort modes allows the order of the file-name-column to match that of the link-column - see screenshot!

1. Open folder A with files, that differ in case
2. split screen to second empty folder B
3. create relative links to all files from A in B
4. create more random files in B
5. sort B by link and try to match the order of A which is sorted for filename

see screenshot

allow one config / sort mode to match the order in those two columns

Windows: n/a
macOS: n/a
Linux/KDE Plasma: 4.18.0-17-generic
(available in About System)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.50.0
Qt Version: 5.11.1

Comment 1 Christoph Feck 2019-04-25 09:10:41 UTC
Only the NameRole gets special treatment, including natural sorting and case-insensitive sorting. At least DestinationRole, but probably also PathRole need the same treatment.

Thinking of it, comments, tags, or other textual roles (genre, artist, album, title, ...) could also benefit from case-insensitive comparison.

Comment 2 Madhur Chauhan 2019-08-02 15:00:45 UTC
I am new to Open Source and I am thinking of getting started with fixing this bug. Any help on getting started would be super helpful.

Comment 3 Christoph Feck 2019-08-20 20:32:18 UTC
Hi Madhur, the first step would be to compile and run Dolphin from source on your system. Which packages you need depends on the distribution. Most package managers know how to install these dependencies.
Comment 4 R Aravind 2019-11-22 14:13:57 UTC
Hi, I am new to Open Source,
So far, I already have my build environment set up and I compiled and ran Dolphin from the source.
I need help in fixing this bug.
Comment 5 Christoph Feck 2019-11-24 05:07:45 UTC
Did you read the link in comment #1? If you don't understand the code linked there, please ask specific questions on KDE or Qt developer channels (mailing lists, IRC, etc.)
Comment 6 gvgeo 2019-12-12 18:26:53 UTC
Made a patch D25741. Although I feel it could take an improvement.
Comment 7 Nate Graham 2019-12-12 20:49:12 UTC
Thank you very much! I'll take a look.
Comment 8 Nate Graham 2020-01-28 15:53:07 UTC
Git commit 9e3418bd558293a92b2e8bcba55f5a3f5d3cc5a4 by Nate Graham, on behalf of George Vogiatzis.
Committed on 28/01/2020 at 15:52.
Pushed by ngraham into branch 'master'.

Add natural sorting and case-insensitive sorting for all role-types

 Add natural sorting and case-insensitive sorting, for all role-types
that benefit from.
FIXED-IN: 19.12.2

Test Plan:
Sort by any role type specified in `isRoleValueNatural()`
Before: Sorting is always case sensitive
After: Sorting according to 'Sorting mode' in configuration.

Reviewers: #dolphin, nicolasfella, meven, elvisangelaccio, ngraham

Reviewed By: #dolphin, meven, elvisangelaccio, ngraham

Subscribers: cfeck, meven, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D25741

M  +18   -8    src/kitemviews/kfileitemmodel.cpp
M  +21   -1    src/kitemviews/kfileitemmodel.h

Comment 9 Holger 2020-01-28 22:49:10 UTC
Thanx. Looking forward for the fix to arrive in the updates.