diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2022-02-28 16:02:58 +0300 |
---|---|---|
committer | Matthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr> | 2022-03-18 02:28:02 +0300 |
commit | 541447723a46a1265a53eaec041472fe03b69ef5 (patch) | |
tree | 61fd499353f050985736ea73e9e6fb586cdb4324 /src/gui | |
parent | a7adca84e26471df3d4a097a3ef6fdd24c1a6a6c (diff) |
remove all usage of QDateTime::toTime_t() to avoid overflow
QDateTime::toTime_t() can overflow if called with a date outside its
domain of working
this method is obsolete and QDateTime::toSecsSinceEpoch() is the
replacement
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/userstatusselectormodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/userstatusselectormodel.cpp b/src/gui/userstatusselectormodel.cpp index 6ae0dd256..fea9fb61c 100644 --- a/src/gui/userstatusselectormodel.cpp +++ b/src/gui/userstatusselectormodel.cpp @@ -436,7 +436,7 @@ QString UserStatusSelectorModel::clearAtReadable(const Optional<ClearAt> &clearA } case ClearAtType::Timestamp: { - const int difference = static_cast<int>(clearAt->_timestamp - _dateTimeProvider->currentDateTime().toTime_t()); + const int difference = static_cast<int>(clearAt->_timestamp - _dateTimeProvider->currentDateTime().toSecsSinceEpoch()); return timeDifferenceToString(difference); } |