KConfig saving mecanism for kcm

Nicolas Fella nicolas.fella at gmx.de
Fri Feb 4 11:52:49 GMT 2022


On 04/02/2022 12:03, Antoine Gatineau wrote:
> Hello dear kde developpers.
>
> I am writing a kcm module for system settings and I have an issue saving the configuration. So I'm reaching out here.
> I can use KConfig to save the data but is goes in .config/systemsettingsrc, merged with the rest of systemsettings data.
>
> As I have multiple groups, I'd prefer to have a dedicated config file for my kcm.
>
> Is KConfig able to do that? How?
>
> Thank you for any information or pointer that would allow this behavior.
> If this is not the right place for such questions, please tell me were to go.
>
> Kind regards
> Antoine

Hi,

when creating a KConfig object without arguments it chooses the config
file based on the app name, which is what you see here.

By passing a name with it you can choose the config file, e.g.
KConfig("mysettings") will save in .config/mysettings

Cheers

Nico



More information about the kde-devel mailing list