Fix ResultModel item moving

Authored by davidedmundson on Jul 2 2018, 10:25 PM.

Description

Fix ResultModel item moving

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

Subscribers: kde-frameworks-devel

Tags: Frameworks

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

Details

Committed
davidedmundsonJul 3 2018, 2:22 PM
Differential Revision
D13866: Fix ResultModel item moving
Parents
R159:4f3469e7b80e: Use more nullptr
Branches
Unknown
Tags
Unknown