Use KConfigXT i.e. PowerDevil::ProfileSettings in profile KCM widgets
A PowerDevil::ActionConfig now receives the profile-specific PowerDevil::ProfileSettings object instead of a KConfigGroup. 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.
Please register or sign in to comment