Unbreak KSortFilterProxyModel
Not sure when and how, but our sort-filter model stopped sorting or filtering properly under certain circumstances due to races in properties initialization order. For example, search in Flatpak KCM is currently unusable, but this patch fixes it.
Deduplicate setting sort & filter role names
Exact same two lines are executed at the end of syncRoleNames() already.
Remove overridden property sourceModel
The custom signal was literally unused. Base class hosts this whole sourceModel property for us, and provides an abstract setter method.
Don't recurse into syncRoleNames
Row count of a proxy model changes as it filters its source model, but that's not a good reason to refresh role names every time. Instead we are only interested in source model's changes.
This reduces amount of insert/remove back and forth signals during filtering, and fixes the permanent "ghost delegate" at the end of a ListView.
Fix multiple sources of truth confusion
Sort and filter roles may come from upstream model's properties (by ID) or from our class (by role name), and it is important to keep track which one was set explicitly and thus should be considered the source of truth at any given moment in time -- especially if/when source model is set afterwards such that these pairs of properties can not sync immediately and have to be delayed instead.
To solve this problem, the an object now stores a flag which determined the source of truth per each pair, and another flag to prevent recursion and switch to "Role ID" source when *RoleChanged signals are emitted NOT as a side-effect of us updating a corresponding *RoleName.