Summary: | Natural sorting does not sort shorter filename first when another one have underscore | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Eric Hoffman <ehoffman> |
Component: | view-engine: general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kfm-devel, tjburrows90 |
Priority: | NOR | ||
Version First Reported In: | 19.12.3 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/system/dolphin/-/commit/06f46b97a018133a9b9851c61c0e00622c6addb3 | Version Fixed In: | |
Sentry Crash Report: |
Description
Eric Hoffman
2020-05-21 16:59:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/410 Git commit e4cc6e69430049366434e3383b1d2ef283ed22cc by Méven Car, on behalf of Eren Karakas. Committed on 19/11/2024 at 09:08. Pushed by meven into branch 'master'. natural sort: exclude extension when comparing filenames Currently natural sort compares the entire filenames (basename.extension) when sorting. This causes eg. "a 2.txt" to appear before "a.txt" when sorted by ascending. This is unintuitive since people prioritize basenames more than file extensions. Instead, change natural sort to compare by basename only and fallback to comparing extensions if basenames were equal. This change causes "a.txt" to appear before "a 2.txt" and matches how other platforms such as GNOME and Windows behave. Related: bug 416025, bug 470538, bug 312027 M +18 -1 src/kitemviews/kfileitemmodel.cpp M +8 -2 src/kitemviews/kfileitemmodel.h M +78 -0 src/tests/kfileitemmodeltest.cpp https://invent.kde.org/system/dolphin/-/commit/e4cc6e69430049366434e3383b1d2ef283ed22cc Git commit 06f46b97a018133a9b9851c61c0e00622c6addb3 by Carl Schwan. Committed on 25/11/2024 at 12:09. Pushed by carlschwan into branch 'release/24.12'. natural sort: exclude extension when comparing filenames Currently natural sort compares the entire filenames (basename.extension) when sorting. This causes eg. "a 2.txt" to appear before "a.txt" when sorted by ascending. This is unintuitive since people prioritize basenames more than file extensions. Instead, change natural sort to compare by basename only and fallback to comparing extensions if basenames were equal. This change causes "a.txt" to appear before "a 2.txt" and matches how other platforms such as GNOME and Windows behave. Related: bug 416025, bug 470538, bug 312027 (cherry picked from commit e4cc6e69430049366434e3383b1d2ef283ed22cc) 23a12f69 natural sort: exclude extension when comparing filenames 9d2d518b natural sort: refactors based on review 46695e10 natural sort: add testcase to compare against alphabetical sort Co-authored-by: Eren Karakas <erenkarakas202@hotmail.com> M +18 -1 src/kitemviews/kfileitemmodel.cpp M +8 -2 src/kitemviews/kfileitemmodel.h M +78 -0 src/tests/kfileitemmodeltest.cpp https://invent.kde.org/system/dolphin/-/commit/06f46b97a018133a9b9851c61c0e00622c6addb3 |