Skip to content

Use KConfigXT i.e. PowerDevil::ProfileSettings in profile KCM widgets

Follow-up to the pure KConfigXT data migration in MR !249 (merged), part of the larger series outlined in #23 (closed). This MR only covers the port of the action config parts, i.e. profiles KCM, whereas the actions themselves are ported in sister MR !251 (merged) for hopefully easier reviewing.


A PowerDevil::ActionConfig now receives the profile-specific PowerDevil::ProfileSettings object instead of a KConfigGroup.action config parts, i.e. This is exposed as profileSettings(), similar to configGroup() before. For loading and saving, the ActionConfig will use the various typesafe getter and setter functions of this object.

In addition, an ActionConfig must now implement an additional pair of functions to get or set whether the action is enabled for the current profile. This is necessary because the ActionEditWidget now cannot simply check whether a config group exists; instead, the action now determines its own enabled-ness based on its knowledge of applicable config entries.

ActionEditWidget is now the owner of a ProfileSettings object. There are three of these out there simultaneously in the profiles KCM, one for each power management profile: "AC", "Battery" and "LowBattery". They can coexist because classes generated by kconfig_compiler are backed by the same KSharedConfig for the same configuration file.

Edited by Jakob Petsovits

Merge request reports