Skip to content

Draft: rulebooksettings: Store rules order in a list instead of consecutive count

Ismael Asensio requested to merge work/rulesettings_order into master

RuleBookSettings stores the information for each rule in a different config group in the same config file (kwinrulesrc).

To load them in order, it currently stores the total rule count and fetches the groups numbered 1..count. This can be problematic when inserting, deleting or reordering them, as KConfig groups are not really designed to be dynamically renamed.

This patch changes the approach to use a new stringlist setting which stores the group names of each rule and their loading order.

Now any group name is valid, so to avoid collisions use random QUuids as group names for newly created rules.

This is the base for some future patches to improve how the KCM manages the rules config, to reduce overhead and automatically detect config changes.

I had a kconf_update script prepared, but it's not really required since there's a "legacy path" which can correctly load previous config files.

Edited by Ismael Asensio

Merge request reports