Add ManagedConfigModule
ClosedPublic

Authored by ervin on Oct 21 2019, 9:09 AM.

Details

Summary

This is a new type of ConfigModule which will manage the state of
"apply" and "defaults" by itself depending on the state of the KConfigXT
objects used within the module.

This is sligthly uncomplete on the "defaults" side due to missing
facilities in ConfigModule, but at least it shows the approach works.

Diff Detail

Repository
R296 KDeclarative
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin created this revision.Oct 21 2019, 9:09 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 21 2019, 9:09 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ervin requested review of this revision.Oct 21 2019, 9:09 AM
bport requested changes to this revision.Oct 21 2019, 9:34 AM
bport added a subscriber: bport.
bport added inline comments.
src/quickaddons/managedconfigmodule.cpp
97

Like above I think we need to set it to true

src/quickaddons/managedconfigmodule.h
211

I think we need to set this value to true by default, because if we don't override it we assume value are not the default one

This revision now requires changes to proceed.Oct 21 2019, 9:34 AM
ervin updated this revision to Diff 68411.Oct 21 2019, 9:39 AM

Addresses bport's comment

Nice!

I'm not super sold on magically doing findChildren to get the config skeletons over an explicit
registerSettings(KCoreConfigSkeleton*).

I'm not against it either, but could you expand on the rationale.

src/quickaddons/managedconfigmodule.cpp
132

Coding style {} is needed for single lines

bport accepted this revision.Oct 21 2019, 10:00 AM

Ok for me, when David remarks are addressed

This revision is now accepted and ready to land.Oct 21 2019, 10:00 AM
src/quickaddons/managedconfigmodule.h
117

I know this is just copy paste, but can you delete this paragraph as per https://phabricator.kde.org/D24824

Nice!

I'm not super sold on magically doing findChildren to get the config skeletons over an explicit
registerSettings(KCoreConfigSkeleton*).

I'm not against it either, but could you expand on the rationale.

You mean here to sell it to you or in the doc or something else?

Indeed the alternative is registerSettings(), I went for the less explicit "children settings" mechanism mostly because it was closer to the older system around KCModule which was very much working by convention.

src/quickaddons/managedconfigmodule.h
211

Right, makes sense for the future code.

davidedmundson accepted this revision.Oct 21 2019, 12:44 PM

Indeed the alternative is registerSettings(), I went for the less explicit "children settings" mechanism mostly because it was closer to the older system around KCModule which was very much working by convention.

Having similarity to the KCModule is a perfectly good reason. Ship it.

ervin marked 4 inline comments as done.Oct 22 2019, 12:18 PM
ervin marked an inline comment as done.
ervin updated this revision to Diff 68530.Oct 22 2019, 12:22 PM

Address David's comments

davidedmundson accepted this revision.Oct 22 2019, 1:39 PM
This revision was automatically updated to reflect the committed changes.