Proposed new KDateTime class

David Jarvie lists at astrojar.org.uk
Tue Nov 15 13:17:42 GMT 2005


On Mon, Nov 14 2005 at 11:06, Tobias Koenig wrote:

>On Mon, Nov 14, 2005 at 01:10:41AM +0000, David Jarvie wrote:
>> operator>(): are these needed?
>Yes, they are. In 4.0 we'd like to be able to serialize libkcal objects,
>so a serializer for a datetime class is a must.

That would require a serialiser for the KTimezone class (which is one of the private 
components of KDateTime). KTimezone is polymorphic, so you couldn't have
    operator>>(QDataStream&, KTimezone&)
because the memory size required by the KTimezone object would be unknown.

Presumably this would have to be implemented as
    operator>>(QDataStream&, KTimezone*&)
instead, with the serialisation method constructing a new KTimezone of the appropriate class, 
and returning a pointer to it. The problem then would be how operator>>() would be able to 
determine which KTimezone sub-class was contained in the QDataStream, given that it doesn't 
know what classes may in the future be derived from it. I can't see how to resolve this 
problem, so if anybody has any suggestions ...

--
David Jarvie.
KAlarm author & maintainer.
http://www.astrojar.org.uk/linux/kalarm.html




More information about the kde-core-devel mailing list