Adjust QtQuickSettings KCM to use KConfigXT in full
ClosedPublic

Authored by ervin on Oct 30 2019, 10:56 AM.

Details

Summary

This removes quite a lot of uneeded code and fixes the automatic default
handling from KConfigXT point of view (this was the wrong integration
scheme with combo boxes).

It also gives me a nice testing ground for a widget based KCM usable
with kcmshell. :-)

Diff Detail

Repository
R119 Plasma Desktop
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 30 2019, 10:56 AM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 30 2019, 10:56 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ervin requested review of this revision.Oct 30 2019, 10:56 AM

That's significantly tidier!

kcms/qtquicksettings/renderer.kcfg
10

Will this mean we write "automaticloop" to the config file?

If so, we'll need to change the KQuickAddons::QtQuickSettings::init
As it passes the variables in the config directly to Qt envs, which wouldn't be ideal.

ervin added inline comments.Oct 30 2019, 11:35 AM
kcms/qtquicksettings/renderer.kcfg
10

Nope. KConfigXT is so clever that if you write a value which is the default to it, it kills the key in the config file instead. :-)

This is why you always want KConfigXT btw, managing defaults is error prone, people forget to kill the key when they do readEntry/writeEntry manually... which means you got something in the config file when the default changes, so you don't see the new default.

davidedmundson accepted this revision.Oct 30 2019, 11:39 AM
This revision is now accepted and ready to land.Oct 30 2019, 11:39 AM
This revision was automatically updated to reflect the committed changes.