[gnome-usage] swap-speedometer: set percentage if there is swap
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] swap-speedometer: set percentage if there is swap
- Date: Mon, 14 Mar 2022 10:24:13 +0000 (UTC)
commit 1a6f8068463bfdd3af09012fd92ddd5d1a7b2638
Author: vfjpl <cosiekvfj o2 pl>
Date: Fri Mar 11 17:27:38 2022 +0000
swap-speedometer: set percentage if there is swap
src/swap-speedometer.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/swap-speedometer.vala b/src/swap-speedometer.vala
index b608a35..8237c2b 100644
--- a/src/swap-speedometer.vala
+++ b/src/swap-speedometer.vala
@@ -41,7 +41,7 @@ public class Usage.SwapSpeedometer : Gtk.Bin {
Timeout.add_seconds (1, () => {
var available = (monitor.swap_total - monitor.swap_usage);
var percentage = 0.0;
- if (available > 0)
+ if (monitor.swap_total > 0)
percentage = (((double) monitor.swap_usage / monitor.swap_total) * 100);
this.speedometer.percentage = (int) percentage;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]