KCM KDED: Add immutability and fix default, reset, apply buttons
ClosedPublic

Authored by bport on Jan 20 2020, 11:37 AM.

Details

Summary
  • Reset and apply button are not activated anymore if we change twice state of an item going back to the current saved state
  • Immutability disable all actions for an entry
  • Default is activated if not all mutable entry are set to true

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 21506
Build 21524: arc lint + arc unit
bport created this revision.Jan 20 2020, 11:37 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 20 2020, 11:37 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
bport requested review of this revision.Jan 20 2020, 11:37 AM
meven added inline comments.Jan 20 2020, 12:26 PM
kcms/kded/modulesmodel.cpp
234

Inserted twice, line 219

bport updated this revision to Diff 73937.Jan 20 2020, 1:26 PM

Fix apply button state after saving a first time

bport added inline comments.Jan 20 2020, 1:27 PM
kcms/kded/modulesmodel.cpp
234

Yes I insert it twice first one is for autoenable value (that will change when we check or uncheck entry), and the second one is the base value to know if data are dirty or not.

ervin added inline comments.Jan 20 2020, 1:58 PM
kcms/kded/kcmkded.cpp
234

Missing space after ,

kcms/kded/modulesmodel.cpp
84

Curly brace should be on its own line

98

Curly brace should be on its own line

bport updated this revision to Diff 74126.Jan 22 2020, 3:06 PM

fix coding style

ervin accepted this revision.Jan 22 2020, 3:14 PM
This revision is now accepted and ready to land.Jan 22 2020, 3:14 PM

Not a fan of the AutoloadEnabledSavedRole in the model

kcms/kded/kcmkded.cpp
268

I think instead you could have the model refuse to setData when immutable

kcms/kded/modulesmodel.cpp
126–127

Since generally setData only does things for AutostartType, perhaps move that check out of the switch

225

Superfluous space

265

Check whether it actually changed before emitting it

bport updated this revision to Diff 74136.Jan 22 2020, 4:07 PM
bport marked 8 inline comments as done.

Take in consideration feedback

bport marked an inline comment as done.Jan 22 2020, 4:08 PM
bport updated this revision to Diff 74137.Jan 22 2020, 4:17 PM

small fixes

This revision was automatically updated to reflect the committed changes.