D20363: CollectionScheduler: port to qint64 to avoid the year-2038 bug

Daniel Vrátil noreply at phabricator.kde.org
Mon Apr 8 12:01:13 BST 2019


dvratil added inline comments.

INLINE COMMENTS

> collectionscheduler.h:60
>  
> +    using TimeT = qint64; // type returned by QDateTime::toMSecsSinceEpoch
> +

I'm tempted to use `std::chrono::time_point` here instead of `qint64`, which is a better abstraction for time units.

You can create a `time_point` from `std::chrono::secods(QDateTime::currentSecsSinceEpoch())`, and a difference of two `time_point`s is a `std::chrono::duration` which can be passed directly to QTimer without having to care about conversion to correct units.

If you don't feel up to it (I remember you mentioned you are not much familiar with `std::chrono`), I'm fine with this version too, I can enhance it later when I get time. Getting this tested and fixed is more important.

REVISION DETAIL
  https://phabricator.kde.org/D20363

To: dfaure, dvratil
Cc: pino, kde-pim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190408/4c4d9094/attachment.html>


More information about the kde-pim mailing list