Fix ResultModel item moving
ClosedPublic

Authored by davidedmundson on Jul 3 2018, 10:30 AM.

Details

Summary

The intention of this code is to find the new insertion index in the
cache where a resource should now be by counting number of items in the
cache with a higher score/update time/whatever.

FixedItems comparison compares two resources by string IDs, checking if
they're user pinned. If so they go on top.

In FullOrdering if neither compared item is pinned it also compares literal
resourceId. Useful if you have no other sorting tests and want to
maintain order, not useful if we want to contintue to compare the score
as in 50% case of the cases we'll fail our lessThan early.

BUG: 396102

Test Plan

Ran test app
Changed some scores by clicking in kickoff
They moved appropriately instead of being moved all over the place

Diff Detail

Repository
R159 KActivities Statistics
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Jul 3 2018, 10:30 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 3 2018, 10:30 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Jul 3 2018, 10:30 AM

In an email

Without being able to test, I can only rely on the fact that the reasoning sounds ok and that it is authored by David 5.
Thanks, you have my blessing to push.

Ivan

So will do so, unless someone objects soon.

hein accepted this revision.Jul 3 2018, 2:22 PM
hein added a subscriber: hein.

It works for me.

This revision is now accepted and ready to land.Jul 3 2018, 2:22 PM
This revision was automatically updated to reflect the committed changes.