Turn Person into a value type
ClosedPublic

Authored by vkrause on May 25 2019, 11:41 AM.

Details

Summary

This has become possible as this is no longer part of a polymorphic type
hierarchy, and avoids an additional allocation per instance. It will also
allow direct consumption from QML.

A similar change also needs to be done to Attendee.

Diff Detail

Repository
R172 KCalendar Core
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vkrause created this revision.May 25 2019, 11:41 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 25 2019, 11:41 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
vkrause requested review of this revision.May 25 2019, 11:41 AM

D21392 - D21397 contain the non-trivial adjustments for this, on top of that there are simple changes required in akonadi-search, calendarsupport, eventviews, kalarm and kdepim-addons.

mlaurent accepted this revision.May 26 2019, 10:15 AM
This revision is now accepted and ready to land.May 26 2019, 10:15 AM
This revision was automatically updated to reflect the committed changes.
dfaure added a subscriber: dfaure.Jul 22 2019, 5:42 PM

This change broke calligra:

/d/kde/src/5/calligra/calligra/plan/src/plugins/filters/icalendar/export/icalendarexport.cpp:143:27: error: ‘Ptr’ is not a member of ‘KCalCore::Person’

KCalCore::Person::Ptr p = KCalCore::Person::fromFullName(node->leader());
                  ^~~

This change broke calligra:

/d/kde/src/5/calligra/calligra/plan/src/plugins/filters/icalendar/export/icalendarexport.cpp:143:27: error: ‘Ptr’ is not a member of ‘KCalCore::Person’
        KCalCore::Person::Ptr p = KCalCore::Person::fromFullName(node->leader());
                          ^~~

Not sure if I'm looking at the same code (path/line numbers don't match), but https://cgit.kde.org/calligraplan.git/tree/src/plugins/filters/icalendar/export/icalendarexport.cpp already seems to have an #ifdef for this (which would need to be extended to the same change in Attendee though).

That's a fork of the code in calligraplan, a separate repository...
But I'll grab that solution, thanks.

Oh, hmm, in calligra/3.1 branch, plan was still in that repo, then it got moved out.

And that's a hack, there's nothing that ever sets that define.... AND the whole code is in #if 0 anyway.

Anyhow, fixed properly. https://commits.kde.org/calligra/2d484fda1b31a72659088a4bfce5c3708e923cb0