Replacement for KDateTime

Sandro Knauß bugs at sandroknauss.de
Sat Aug 1 19:47:16 BST 2015


Hello,

the kdepim is discussing how we can replace KDateTime inside kdepim (primarly 
kcalcore) . There are some issues, why we can't replace it simply with 
QDateTime.

* indivual timezone support, this is something that we need when parsing ical 
and have no known timezone information. I havn't looked into it, but I think 
this can make it eventually into QDateTime.

* dateOnly support is used a lot. In ICAL it differs if you set dateonly or 
datetime. dateonly events f.ex. lasts a day without timezone info f.ex. "New 
Year" is a dateonly event that lasts one day - it everywhere startsat 1. 
january at 0:00 o'clock and ends at 24:00 o'clock  in your current timezome. 
So it a different UTC time for every place at the world. That's why you can't 
replace it with a datetime event, that needs a timezone, so it would be 
wrongly displayed at other timezones.

The core problem is with that that QDateTime is invalid if either the date or 
the time is invalid. KDateTime is valid also with invalid time. And this is 
behaviour change cannot go into QDateTime, that's why we need anything to 
replace KDateTime.

The solutions we are were came along at akademy:

* using QDateTime in a inalid way and check on our own if time&date are valid 
- This approch would lead to many errors, because every application must be 
aware, that qdatetime is used in a "strange way"

* split the API everywhere into date and time members/functions -> makes it 
much more worse to use the API, because you have to request everytime both 
elements.

* keep KDateTime  and transform it to an own framework -> this is a very big 
overhead for only one feature

As midterm solution we came up to split KDateTime to an own lib inside 
kde4support, so that we can acctually get rid of linking to every other lib, 
that would help to make the start faster and the memory footprint smaller.

Nothing is hammered in stone and I want to start a disscussion, maybe others 
have good suggestions how we can solve this issues.

Just for clearifing it- it is only a discussion about how we should transform 
the public API of kcalcore.

Regards,

sandro

PS: I had a very nice time attending the akademy!




More information about the kde-core-devel mailing list