Bug 406296

Summary: [Dolphin] Inconsistent sort order
Product: [Applications] dolphin Reporter: Holger <private_lock>
Component: view-engine: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aravind.ar786, Gvgeo, madhur4127, nate, nazark
Priority: NOR Keywords: junior-jobs
Version: 18.04.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=410538
Latest Commit: Version Fixed In: 20.04.0
Attachments: screenshot inconsitent sort order

Description Holger 2019-04-07 12:11:48 UTC
Created attachment 119282 [details]
screenshot inconsitent sort order

SUMMARY

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

STEPS TO REPRODUCE
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

OBSERVED RESULT
see screenshot

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

SOFTWARE/OS VERSIONS
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

ADDITIONAL INFORMATION
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.

https://cgit.kde.org/dolphin.git/tree/src/kitemviews/kfileitemmodel.cpp#n1748
Comment 2 Madhur Chauhan 2019-08-02 15:00:45 UTC
Hi,
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.

Thanks!
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.
https://phabricator.kde.org/D25741
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

Summary:
 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

https://commits.kde.org/dolphin/9e3418bd558293a92b2e8bcba55f5a3f5d3cc5a4
Comment 9 Holger 2020-01-28 22:49:10 UTC
Thanx. Looking forward for the fix to arrive in the updates.