Event view can use the CollectionColorAttribute color
ClosedPublic

Authored by ochurlaud on Aug 24 2017, 6:04 AM.

Details

Summary

This introduces 3 changes in Helper:

  • 3 Helper functions are now exported
  • resourceColor() checks if a color is set in the preferences files. If yes, it uses it. If not, it checks if there is a CollectionColorAttribute in the collection. If yes, it uses it else it call the resourceColor() from prefs (that can create a new color or return an invalid one)
  • setResourceColor() set a color in the preferences files ONLY IF it's not the same as the CollectionColor Attribute.

Diff Detail

Repository
R76 PIM: Event Views
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ochurlaud created this revision.Aug 24 2017, 6:04 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptAug 24 2017, 6:04 AM
dkurz added a subscriber: dkurz.Aug 24 2017, 6:52 AM
dkurz added inline comments.
src/helper.cpp
50

Should the color preference for this calendar be reset here? If preference == red, collection color == blue, and then the user decides to set preference = blue, this wouldn't have an effect and still display red, would it?

92

Lines 84-92 are the same as lines 65-73 (except for "coll" vs. "item.parentCollection()"), so it should probably be extracted to a method.

ochurlaud marked an inline comment as done.Aug 24 2017, 6:50 PM
ochurlaud added inline comments.
src/helper.cpp
92

I wouldn't do that as @dvratil said we might need to deprecate the "item" version...

ochurlaud updated this revision to Diff 18710.Aug 24 2017, 6:52 PM

Update to follow @dkurz comments

mlaurent requested changes to this revision.Aug 25 2017, 4:36 AM
mlaurent added a subscriber: mlaurent.

You exported/install Helper so you need to increase lib version => increase it in CMakeLists.txt top level.
Thanks

This revision now requires changes to proceed.Aug 25 2017, 4:36 AM

You exported/install Helper so you need to increase lib version => increase it in CMakeLists.txt top level.

Only this lib? 5.8.41? 5.9?

only this lib "5.8.41"
thanks

5.6.41
not 5.8.41

ochurlaud updated this revision to Diff 18791.Aug 26 2017, 8:22 AM
ochurlaud edited edge metadata.

Increase lib version

ochurlaud updated this revision to Diff 18792.Aug 26 2017, 8:23 AM

Update lib version and add CMakeLists.txt to the patch

dvratil requested changes to this revision.Aug 26 2017, 9:16 AM
dvratil added inline comments.
CMakeLists.txt
36

Change the value of PIM_VERSION at the top of the file, keep the variable used here.

This revision now requires changes to proceed.Aug 26 2017, 9:16 AM
ochurlaud updated this revision to Diff 18798.Aug 26 2017, 9:24 AM
ochurlaud edited edge metadata.

Use the PIM_VERSION variable

ochurlaud marked an inline comment as done.Aug 26 2017, 9:25 AM
dvratil accepted this revision.Aug 26 2017, 9:27 AM

Thanks!

mlaurent accepted this revision.Aug 26 2017, 11:40 AM

Seems ok for me.

This revision is now accepted and ready to land.Aug 26 2017, 11:40 AM
This revision was automatically updated to reflect the committed changes.
dfaure added a subscriber: dfaure.Apr 18 2020, 9:18 AM
dfaure added inline comments.
src/helper.cpp
51

For the record: this was broken, a return; was missing after this line, so we would anyway proceed to saving the color, 3 lines below.

But no matter, D28937 removes all this logic. If we actually save into the attribute we don't need it anymore.