Save calendar colors immediately rather than on exit.
ClosedPublic

Authored by dfaure on Aug 18 2017, 12:46 PM.

Details

Summary

They were lost if the app would crash on exit...

Test Plan

changing a calendar color and watching ~/.config/eventviewsrc be updated immediately

Diff Detail

Repository
R210 KOrganizer
Branch
Applications/17.08
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure created this revision.Aug 18 2017, 12:46 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptAug 18 2017, 12:46 PM
dkurz added a subscriber: dkurz.Aug 18 2017, 4:13 PM

What happens if the user sets the color back to default? We wouldn't get past line 760, and disableColor() wouldn't be called, so the color would not be saved immediately, right?

In D7387#137153, @dkurz wrote:

What happens if the user sets the color back to default? We wouldn't get past line 760, and disableColor() wouldn't be called, so the color would not be saved immediately, right?

If you want to set it back to default, you call disableColor().
myColor.isValid() is about checking for "cancel" in the color dialog, and myColor != defaultColor is about not making any change if the user selected the same color again (no-op). I don't see how assignColor() can ever have the meaning of "setting the color back to default".

mlaurent accepted this revision.Aug 19 2017, 6:31 AM
mlaurent added a subscriber: mlaurent.

Seems ok for me.
Thanks

This revision is now accepted and ready to land.Aug 19 2017, 6:31 AM
dfaure closed this revision.Aug 23 2017, 9:12 PM