MCPcopy Create free account
hub / github.com/ElementsProject/elements / formatDurationStr

Function formatDurationStr

src/qt/guiutil.cpp:786–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784}
785
786QString formatDurationStr(std::chrono::seconds dur)
787{
788 const auto secs = count_seconds(dur);
789 QStringList strList;
790 int days = secs / 86400;
791 int hours = (secs % 86400) / 3600;
792 int mins = (secs % 3600) / 60;
793 int seconds = secs % 60;
794
795 if (days)
796 strList.append(QObject::tr("%1 d").arg(days));
797 if (hours)
798 strList.append(QObject::tr("%1 h").arg(hours));
799 if (mins)
800 strList.append(QObject::tr("%1 m").arg(mins));
801 if (seconds || (!days && !hours && !mins))
802 strList.append(QObject::tr("%1 s").arg(seconds));
803
804 return strList.join(" ");
805}
806
807QString formatServicesStr(quint64 mask)
808{

Callers 3

TimeDurationFieldFunction · 0.85
setTrafficGraphRangeMethod · 0.85
updateDetailWidgetMethod · 0.85

Calls 2

count_secondsFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected