Bug 394355

Summary: Incorrect sort by track number
Product: [Applications] dolphin Reporter: Stuart Trotter <s.g.trotter>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: elvis.angelaccio, kde, nate
Priority: NOR    
Version: 17.12.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot of current sorting

Description Stuart Trotter 2018-05-17 07:27:53 UTC
Created attachment 112698 [details]
Screenshot of current sorting

Track number sorted so that all the numbers starting with a 1 are sorted first and then all or the numbers with a 2 leading to sorting that goes 1, 10, 11... 2, 20, 21...

It would be better to have sorting that sorts 1, 2, 3...
Comment 1 Kai Uwe Broulik 2018-05-17 08:48:52 UTC
Can you check whether you have natural sorting enabled in Dolphin General settings? Also, does this happen also with file names? ie. "Foo 1.txt", "Foo 10.txt", "Foo 2.txt"?
Comment 2 Stuart Trotter 2018-05-17 14:02:57 UTC
Natural sorting is enabled and I have checked with file names and they are sorted correctly
Comment 3 Kai Uwe Broulik 2018-05-17 15:09:07 UTC
Confirmed, patch https://phabricator.kde.org/D12948
Comment 4 Kai Uwe Broulik 2018-05-22 11:34:56 UTC
Git commit 05d5792ac303eac90aab28f617e6e72727277002 by Kai Uwe Broulik.
Committed on 22/05/2018 at 11:34.
Pushed by broulik into branch 'master'.

Properly sort int roles

Use integer comparison for word count, line count, track, and release year.

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

M  +5    -1    src/kitemviews/kfileitemmodel.cpp

https://commits.kde.org/dolphin/05d5792ac303eac90aab28f617e6e72727277002