Replacement for KDateTime

Sergio Martins iamsergio at
Sun Aug 9 16:25:25 BST 2015

On Tuesday, August 04, 2015 14:48:02 John Layt wrote:
> On 4 August 2015 at 10:45, John Layt <jlayt at> wrote:
> > Most of this discussion is very very off-topic, it belongs on the Qt
> > development list, can we get back to the main topic of KCalCore and
> > QDateTime? I have limited time to spare and I'd rather use it to solve
> > the immediate problems that we can fix.


I think QDateTime is fine, it has a date and a time part just like KDateTime.
We just need to decorate it a bit to get the semantics we need.


namespace KCalCore {
class DateTime : public QDateTime { // Or composition instead of inheritance
    bool isValid() const { return date.isValid(); }
    bool isDateOnly() const { return date.isValid() && !time.isValid(); }

This is imho the simplest solution, isValid() is called *all* over the place 
in kdepim, any another approach will be a lot of work.

P.S.: can we drop kde-core-devel at from this thread now? Since we're not 
moving KDateTime to a separate library anymore.

Sérgio Martins
KDE PIM mailing list kde-pim at
KDE PIM home page at

More information about the kde-core-devel mailing list