New framework: KCalCore
Volker Krause
vkrause at kde.org
Thu Apr 11 17:08:48 BST 2019
On Monday, 8 April 2019 02:44:46 CEST Alexander Potashev wrote:
> вс, 7 апр. 2019 г. в 17:24, Alexander Potashev <aspotashev at gmail.com>:
> > вс, 7 апр. 2019 г. в 15:45, Volker Krause <vkrause at kde.org>:
> > > Hi,
> > >
> > > I'd like to propose KCalCore for review to move from KDE PIM to KF5.
> > >
> > > KCalCore is an implementation of the iCalendar standard based on
> > > libical,
> > > covering the data model, input/output and the rather complex recurrence
> > > algorithms defined in that standard. It's used outside of KDE PIM as
> > > well,
> > > e.g. by Zanshin or the Plasma Mobile calendar app.
> >
> > Hi Volker,
> >
> > While porting KTimeTracker to KF5, I noticed that KCalCore lost KIO
> > support on the way from KDELibs4 to KF 5.0.
>
> Another pitfall is shared pointers required everywhere. Because of
> them, one can't easily subclass KCalCore classes.
Sorry for the delay, finally found the time to look into this properly.
> Examples:
> 1. KTimeTracker has a class [1] derived from
> KCalCore::MemoryCalendar. In order to pass "this" into
> KCalCore::FileStorage ctor, it also stores a QWeakPointer to recover
> the associated shared pointer. I would love if KCalCore::FileStorage
> could accept a plain pointer to KCalCore::Calendar, there is no reason
> to make it shared pointer.
There is a reason this uses shared pointers everywhere: to avoid dangling
references or leaked memory. Allowing to bypass that seems like a very
slippery slope. In this specific case I think the pain comes from using a
class inside a calendar object that seems rather meant for being used
alongside one.
> 2. akonadi-calendar uses the same approach [2]. Kudos to whoever
> invented this clever hack
I tried to find where this is actually needed, and it seems to be entirely
unused. Removed in D20472.
Regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190411/2e534ac5/attachment.sig>
More information about the Kde-frameworks-devel
mailing list