https://bugs.kde.org/show_bug.cgi?id=446381

Ismael Asensio <isma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |6.1
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/kwin/-/commit/d2d92cdfd2
                   |                            |c1869942cf119b2b8f680750fa7
                   |                            |e96
         Resolution|---                         |FIXED

--- Comment #6 from Ismael Asensio <isma...@gmail.com> ---
Git commit d2d92cdfd2c1869942cf119b2b8f680750fa7e96 by Ismael Asensio.
Committed on 13/05/2024 at 18:18.
Pushed by iasensio into branch 'master'.

rules/RuleBook: Optimize saving discarded rules to config

After porting to KConfigXT settings some time ago, there was still an
inefficient and error-prone codepath between the `RuleBook` (which keeps
the runtime list of `Rules`) and the `RuleBookSettings` (responsible for
config reads and saves), in the form of the `setRules()` method.

We can eliminate the `setRules()` codepath, reducing unnecessary
runtime process and file access operations, and instead:
- Keep track of the config `id` in the `Rules` objects
- Keep a single `RuleBookSettings` object as a member
- Modify or delete the discarded rules settings directly
- Save when necessary

This also fixes two bugs/pitfalls of the previous solution:
- the config group id for each rule is now preserved instead of creating
  new ones
- no leftovers on the config file for the discarded groups and entries

Setting custom configs for the integration tests still works unchanged.
FIXED-IN: 6.1

M  +12   -44   src/rulebooksettings.cpp
M  +2    -4    src/rulebooksettings.h
M  +29   -13   src/rules.cpp
M  +6    -6    src/rules.h

https://invent.kde.org/plasma/kwin/-/commit/d2d92cdfd2c1869942cf119b2b8f680750fa7e96

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to