KCM launchfeedback : port to KConfig XT
ClosedPublic

Authored by crossi on Nov 13 2019, 4:14 PM.

Details

Summary

Simple KCM, all settings' states are automatically handled thanks to ManagedConfigModule.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 18821
Build 18839: arc lint + arc unit
crossi created this revision.Nov 13 2019, 4:14 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 13 2019, 4:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
crossi requested review of this revision.Nov 13 2019, 4:14 PM

So much red!

Wow, we're almost at a stage where we don't need to load a C++ plugin at all.

kcms/launch/package/contents/ui/main.qml
34–37

This is a bit of a boolean trap.

We could declare an enum in QML
setCursorSettings(Busy | Blinking) would be a bit nicer maybe?

Up to you.

46

onToggled is called both when it is checked, and presumably when it is unchecked (or another button is checked)

I assume we want something more like:

onToggled: {if (!checked) return; formLayout.setCursorSettings(false,...}

97

taskar -> taskbar

davidedmundson requested changes to this revision.Nov 14 2019, 11:11 AM
This revision now requires changes to proceed.Nov 14 2019, 11:11 AM
broulik added inline comments.
kcms/launch/package/contents/ui/main.qml
34–37

Yes, I would prefer all of this to be abstracted away from the QML, the checked bindings area also quite messy

46

onToggled fires when user explicitly toggles it by clicking it. Given you can't "untoggle" a radio button should be fine-ish?

95

Use onValueModified which only fires when the user explicitly changes it, not because of some binding updates

crossi added inline comments.Nov 14 2019, 12:36 PM
kcms/launch/package/contents/ui/main.qml
34–37

I agree it's a bit tricky, we have a kind of enum choice written as a binary representation in the config file.

Will try to work it with a QML enum to make it less confusing.

46

According to Qt documentation :

This signal is emitted when a checkable button is interactively toggled by the user via touch, mouse, or keyboard.

Since it's a radio button, you can't uncheck it, so the signal is emitted only when checked. I've tested both as I first tought like david said.

95

Sounds better. wiil fix.

97

good catch, thanks. will fix.

crossi updated this revision to Diff 69745.Nov 14 2019, 1:02 PM

Use proper signal handler & Fix typo

ervin added inline comments.Nov 15 2019, 7:15 AM
kcms/launch/package/contents/ui/main.qml
34–37

Or... but that's more work and I'd say it should come in another patch on top of that one. We migrate the config file to use an enum all the way. This boolean trap exists in the config after all.

crossi updated this revision to Diff 69794.Nov 15 2019, 11:00 AM

Add enum declaration to make boolean settings in qml a bit more readable.

crossi added inline comments.Nov 15 2019, 11:10 AM
kcms/launch/package/contents/ui/main.qml
34–37

Added enum to remove the triple boolean parameter.

To solve the boolean trap, it means to change the config to an enum instead of 3 booleans. This patch is intended to port Launch Feedback to KConfig XT, we could fix the configuration issue in another patch.

davidedmundson accepted this revision.Nov 15 2019, 2:32 PM
This revision is now accepted and ready to land.Nov 15 2019, 2:32 PM
ervin accepted this revision.Nov 18 2019, 7:34 AM
This revision was automatically updated to reflect the committed changes.