[Night Color KCM] Reset seconds and milliseconds in provided timings
ClosedPublic

Authored by zzag on Oct 29 2019, 4:41 PM.

Details

Summary

When a user tries to set operation mode to "Times", the Apply button
remains enabled after it's been clicked. The reason for that is timings
provided by the kcm include seconds and milliseconds, while timings
sent by KWin don't.

Because seconds and milliseconds are different, CompositorAdapter::
checkStaged() will return false even though hours and minutes haven't
been modified by the user.

In order to address this problem, my patch adjusts the TimeField
component so it provides Date objects with seconds and milliseconds set
to 0. There is another way to fix this issue though. We could check in
CompositorAdaptor::checkStaged() method whether only hours and
minutes have been modified.

Test Plan
  • Set operation mode to "Times"
  • Click the Apply button
  • Check that the Apply button is disabled

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.
zzag created this revision.Oct 29 2019, 4:41 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 29 2019, 4:41 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
zzag requested review of this revision.Oct 29 2019, 4:41 PM
zzag edited the summary of this revision. (Show Details)Oct 29 2019, 4:47 PM
broulik accepted this revision.Oct 31 2019, 9:05 AM
This revision is now accepted and ready to land.Oct 31 2019, 9:05 AM
This revision was automatically updated to reflect the committed changes.