summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-05-13 17:51:29 +0200
committerBenjamin Berg <benjamin@sipsolutions.net>2022-05-16 09:14:07 +0000
commitb4e9cd97399d97a7da074d461abfc98ffb28a868 (patch)
tree4189c666d7f4a8a7893288645cbc1a1944b3a7a8
parent4cccf81cad738fac9bde941d5a12fca675f29dc8 (diff)
daemon: Only refresh batteries when the "online" state changes
There is no need to refresh batteries if we just re-read the status of a line power supply without actually seeing a change ("online" vs. "update-time" property). Fixes: #184
-rw-r--r--src/up-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index 52264f3..a10d9cb 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -788,7 +788,7 @@ up_daemon_device_changed_cb (UpDevice *device, GParamSpec *pspec, UpDaemon *daem
g_object_get (device,
"type", &type,
NULL);
- if (type == UP_DEVICE_KIND_LINE_POWER) {
+ if (type == UP_DEVICE_KIND_LINE_POWER && g_strcmp0 (prop, "online") == 0) {
/* refresh now */
up_daemon_refresh_battery_devices (daemon);
}