From 2633ff3fb996ccf471d04a7c2b94ba07bbfed126 Mon Sep 17 00:00:00 2001 From: Erik Reider Date: Sat, 19 Mar 2022 23:00:08 +0100 Subject: [PATCH] Fixed time_left string not being set properly --- src/modules/upower/upower.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/upower/upower.cpp b/src/modules/upower/upower.cpp index 5f4d00b6..9b13c953 100644 --- a/src/modules/upower/upower.cpp +++ b/src/modules/upower/upower.cpp @@ -281,17 +281,15 @@ auto UPower::update() -> void { uint tooltipCount = 0; - std::string time_full_format = timeToString(time_full); - std::string time_empty_format = timeToString(time_full); std::string time_format = ""; switch (state) { case UP_DEVICE_STATE_CHARGING: case UP_DEVICE_STATE_PENDING_CHARGE: - time_format = time_full_format; + time_format = timeToString(time_full); break; case UP_DEVICE_STATE_DISCHARGING: case UP_DEVICE_STATE_PENDING_DISCHARGE: - time_format = time_empty_format; + time_format = timeToString(time_empty); break; default: break;