Use natural sorting in ActivityModel

Authored by davidedmundson on Feb 12 2019, 12:55 PM.



ActivityModel sorts internally.
It currently does a non-locale or number aware sort on user-facing

This patches uses QCollator.

This changes the order in the KCM.

It doesn't affect the order in the activity switcher as that has it's
own sorting proxy on top handling last used time.

It doesn't quite fix the issue in the bug report as PagerModel mixes

CCBUG: 404149

Test Plan

Set activities named

KCM now shows them in the order 1,2,10

Diff Detail

R6 KActivities
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 12 2019, 12:55 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Feb 12 2019, 12:55 PM
ngraham accepted this revision.Feb 12 2019, 3:52 PM
ngraham added a subscriber: ngraham.


I believe the bug is about the switcher though, not the KCM.

This revision is now accepted and ready to land.Feb 12 2019, 3:52 PM
apol added a subscriber: apol.Feb 12 2019, 6:18 PM
apol added inline comments.

Do you think it would be possible to store the collator elsewhere?
Re-creating it is a bit expensive to be doing it nlogn times per sort (not that it won't work).

We don't support changing the application language at runtime (env vars don't change at runtime), so it shouldn't be a big deal (it could even be a static variable).

This revision was automatically updated to reflect the committed changes.