refactor: Use C++20 std::chrono::days

This commit is contained in:
MarcoFalke 2023-12-08 17:15:16 +01:00
parent d5e5810bd3
commit faea30227b
No known key found for this signature in database

View file

@ -723,8 +723,7 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
QString formatDurationStr(std::chrono::seconds dur)
{
using days = std::chrono::duration<int, std::ratio<86400>>; // can remove this line after C++20
const auto d{std::chrono::duration_cast<days>(dur)};
const auto d{std::chrono::duration_cast<std::chrono::days>(dur)};
const auto h{std::chrono::duration_cast<std::chrono::hours>(dur - d)};
const auto m{std::chrono::duration_cast<std::chrono::minutes>(dur - d - h)};
const auto s{std::chrono::duration_cast<std::chrono::seconds>(dur - d - h - m)};