diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-10-28 15:47:00 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-11-25 16:51:05 +0300 |
commit | fcf065a0cf52f69d9651211c6175e1e8f5b8bfe7 (patch) | |
tree | 205640b3df5062960ee05ef0ec0d765bb521af91 /src/gui/folderman.cpp | |
parent | a0bf5f9fb91804693575975155f9e15575d33d7f (diff) |
Use some more std::chrono
Diffstat (limited to 'src/gui/folderman.cpp')
-rw-r--r-- | src/gui/folderman.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 5b5ab3d70..65046642e 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -36,6 +36,9 @@ #include <QSet> #include <QNetworkProxy> +using namespace std::chrono; +using namespace std::chrono_literals; + namespace { /* * [Accounts] @@ -815,18 +818,18 @@ void FolderMan::startScheduledSyncSoon() return; } - std::chrono::seconds delay; - std::chrono::seconds sinceLastSync; + seconds delay; + seconds sinceLastSync; // Require a pause based on the duration of the last sync run. if (Folder *lastFolder = _lastSyncFolder) { - sinceLastSync = std::chrono::duration_cast<std::chrono::seconds>(lastFolder->msecSinceLastSync()); + sinceLastSync = duration_cast<seconds>(lastFolder->msecSinceLastSync()); // 1s -> 1.5s pause // 10s -> 5s pause // 1min -> 12s pause // 1h -> 90s pause - delay = std::chrono::seconds(static_cast<int64_t>(qSqrt(std::chrono::duration_cast<std::chrono::seconds>(lastFolder->msecLastSyncDuration()).count()) / 20)); + delay = seconds(static_cast<int64_t>(qSqrt(duration_cast<seconds>(lastFolder->msecLastSyncDuration()).count()) / 20)); } // Delays beyond one minute seem too big, particularly since there |