refactor: call parent update

This commit is contained in:
Alex
2020-04-12 18:30:21 +02:00
parent 0f0765e517
commit b40cdcb5bd
17 changed files with 39 additions and 53 deletions

View File

@ -149,11 +149,6 @@ const std::string waybar::modules::Battery::formatTimeRemaining(float hoursRemai
}
auto waybar::modules::Battery::update() -> void {
// Run user-provided update handler if configured
if (config_["on-update"].isString()) {
AModule::update();
}
auto [capacity, time_remaining, status] = getInfos();
if (status == "Unknown") {
status = getAdapterStatus(capacity);
@ -192,4 +187,6 @@ auto waybar::modules::Battery::update() -> void {
fmt::arg("icon", getIcon(capacity, state)),
fmt::arg("time", formatTimeRemaining(time_remaining))));
}
// Call parent update
ALabel::update();
}