Factor out coloring from AgendaItem::paintEvent.
ClosedPublic

Authored by dkurz on Oct 9 2018, 8:26 PM.

Details

Summary

The paintEvent method is already quite long, and calculating colors
inline prohibits a lot of const uses. This commit factors it out into
easily comprehensible small new methods, also making it more obvious
where to look for agenda item coloring for future changes.

Test Plan

I tried all color settings for Agenda View and could not
find different behavior with or without patch -- just as expected, as
is a refactoring patch

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.
dkurz created this revision.Oct 9 2018, 8:26 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 9 2018, 8:26 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dkurz requested review of this revision.Oct 9 2018, 8:26 PM
dvratil added inline comments.
src/agenda/agendaitem.h
282

Those look like they could all be const methods?

dkurz updated this revision to Diff 43273.Oct 10 2018, 9:36 AM
  • Add missing const qualifiers
dkurz marked an inline comment as done.Oct 10 2018, 9:38 AM

Forgetting consts in a Diff that is motivated by added consts. Nice! ;-) I added them.

dvratil accepted this revision.Oct 11 2018, 12:43 PM

Sorry for the delay, I had a hard time matching your changes in the logic to the original code :) looks good though. Thanks.

This revision is now accepted and ready to land.Oct 11 2018, 12:43 PM
This revision was automatically updated to reflect the committed changes.