more unfinished changes, process tab for dashboard

This commit is contained in:
2026-09-30 14:26:50 +02:00
parent 0bfda04e91
commit 359f832609
98 changed files with 8633 additions and 2983 deletions
+18
View File
@@ -14,6 +14,24 @@ bool finitePositive(qreal v) {
namespace ZShell::services::usagefmt {
FormatResult UsageFmt::formatKib(qreal kib) const {
if (!finitePositive(kib)) {
return {0.0, 0.0, "KiB"};
}
if (kib >= kGib) {
return {kib / kGib, 0.0, "GiB"};
}
if (kib >= kMib) {
return {kib / kMib, 0.0, "MiB"};
}
if (kib >= kKib) {
return {kib / kKib, 0.0, "KiB"};
}
return {kib, 0.0, "KiB"};
}
FormatResult UsageFmt::formatKib(qreal kib, qreal total) const {
if (!finitePositive(kib) || !finitePositive(total)) {
return {0.0, 0.0, "KiB"};