| 784 | } |
| 785 | |
| 786 | QString 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 | |
| 807 | QString formatServicesStr(quint64 mask) |
| 808 | { |
no test coverage detected