[Kde-pim] parseRFCDate/parseISODate - wrong bad date handling (PATCH)

David Jarvie djarvie at kde.org
Wed Jul 16 23:59:27 BST 2008


On Wed 16 July 2008 18:02:58 Michal Hlavinka wrote:
> You are right, KDateTime returns uint, my mistake. I don't know where
> I've found it's time_t...
> So the right fix would be
>
> from this:
>     time_t res = KDateTime::fromString(str, KDateTime::ISODate).toTime_t();
>     return res != -1 ? res : 0;
>
> to this:
>     uint res = KDateTime::fromString(str, KDateTime::ISODate).toTime_t();
>     return res != uint(-1) ? time_t(res) : 0;
>
>
> ...if it's correct to assume QDateTime() (an invalid value) will be
> always converted to uint(-1). I didn't find it anywhere, as I've writen
> already.

I've now fixed KDateTime::toTime_t() to always return uint(-1) if the 
KDateTime instance is invalid. Previously that wasn't guaranteed.

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list