https://bugs.kde.org/show_bug.cgi?id=411707

Méven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/syst
                   |                            |em/dolphin/-/commit/0d10eff
                   |                            |3726e5de60298452308cc4b2b78
                   |                            |20e10b
         Resolution|---                         |FIXED

--- Comment #6 from Méven <[email protected]> ---
Git commit 0d10eff3726e5de60298452308cc4b2b7820e10b by Méven Car, on behalf of
Pan Zhang.
Committed on 02/04/2026 at 14:17.
Pushed by meven into branch 'master'.

kfileitemmodel: sort dotted numeric names naturally

Natural sorting already handled plain numeric chunks, but names containing dots
between numeric segments were still ordered lexically in important cases. This
broke expected ordering for decimal-style names like 0.09 and 0.1, and for
version-like names such as v1.2.3 and v1.2.10.

Teach KFileItemModel's natural string comparison to recognize dotted numeric
chains instead of relying solely on QCollator's numeric mode. Compare two-part
numeric chains (e.g. 0.09 vs 0.1) as decimal values, and compare longer chains
segment by segment like version numbers, while still treating real file
extensions separately so names like 1.09.txt keep working correctly.

Add a direct unit test for KFileItemModel::stringCompare covering decimal-style
names, version-like dotted numeric names, numeric basenames with extensions,
leading-dot names, and the non-natural sorting fallback.

M  +232  -13   src/kitemviews/kfileitemmodel.cpp
M  +37   -0    src/tests/kfileitemmodeltest.cpp

https://invent.kde.org/system/dolphin/-/commit/0d10eff3726e5de60298452308cc4b2b7820e10b

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to