diff options
author | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-08-18 22:46:30 +0300 |
---|---|---|
committer | Kevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com> | 2020-09-01 09:37:03 +0300 |
commit | 80cc196f6fa9973b372164f0404463f10e498e07 (patch) | |
tree | 7acb071546dfd0385aba8f3f30ca018963918e3b /src/gui/userinfo.cpp | |
parent | 5cec1373ad6d28845a9588033171cd65dc29fc1e (diff) |
Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Diffstat (limited to 'src/gui/userinfo.cpp')
-rw-r--r-- | src/gui/userinfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/userinfo.cpp b/src/gui/userinfo.cpp index d26bcab9c..2962d3355 100644 --- a/src/gui/userinfo.cpp +++ b/src/gui/userinfo.cpp @@ -57,7 +57,9 @@ void UserInfo::setActive(bool active) void UserInfo::slotAccountStateChanged() { if (canGetInfo()) { - auto elapsed = _lastInfoReceived.msecsTo(QDateTime::currentDateTime()); + // Obviously assumes there will never be more than thousand of hours between last info + // received and now, hence why we static_cast + auto elapsed = static_cast<int>(_lastInfoReceived.msecsTo(QDateTime::currentDateTime())); if (_lastInfoReceived.isNull() || elapsed >= defaultIntervalT) { slotFetchInfo(); } else { |