Incompatible calendar classes?
David Faure
faure at kde.org
Sat Apr 1 22:21:06 BST 2017
I've been trying to fix the fact that when receiving an invitation in standalone kmail,
the full calendar is loaded once to display the invitation (because it lists events happening at the same time)
and then the full calendar is loaded again when accepting the invitation,
to insert the event (and whatever else ITIPHandler does).
I noticed that BodyPartFormatter knows about a calendar and
ITIPHandler has a setCalendar(), so it seemed to me that it was just about passing the info via the right classes...
I passed the BodyPart around in the text/calendar formatter, to then do
+ MemoryCalendarMemento *memento = dynamic_cast<MemoryCalendarMemento *>(bodyPart->memento());
- SyncItipHandler *itipHandler = new SyncItipHandler(receiver, iCal, type);
+ SyncItipHandler *itipHandler = new SyncItipHandler(receiver, iCal, type, memento->calendar());
But... surprise, those are different types of calendar.
This is a KCalCore::MemoryCalendar (either from CalendarSupport::calendarSingleton or FetchJobCalendar)
while ITIPHandler wants a Akonadi::CalendarBase::Ptr, looks like a completely different class hierarchy.
Is there any solution, or are we doomed to load the calendar twice?
(or did I completely misunderstand what's going on?)
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the kde-pim
mailing list