diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-23 17:04:22 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-26 14:55:15 +0200 |
commit | feea39fa43f65bc556216f2bcc0fdf1cc6098aba (patch) | |
tree | bee66314efc81c884f95ba01db0ff3b50d409b00 /src | |
parent | 9ce7b4408fd66a578873a3c5b3e1b8aa4416795e (diff) | |
download | upower-feea39fa43f65bc556216f2bcc0fdf1cc6098aba.tar.gz |
linux: Only disable timeouts if ever set
We cannot ever set the refresh timeout when we have a power line
device, so don't try and remove it there.
Diffstat (limited to 'src')
-rw-r--r-- | src/linux/up-device-supply.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 17559b5..5ee0975 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -1090,17 +1090,17 @@ up_device_supply_refresh (UpDevice *device) UpDeviceKind type; UpDeviceState state; - if (supply->priv->poll_timer_id > 0) { - g_source_remove (supply->priv->poll_timer_id); - supply->priv->poll_timer_id = 0; - } - g_object_get (device, "type", &type, NULL); switch (type) { case UP_DEVICE_KIND_LINE_POWER: ret = up_device_supply_refresh_line_power (supply); break; default: + if (supply->priv->poll_timer_id > 0) { + g_source_remove (supply->priv->poll_timer_id); + supply->priv->poll_timer_id = 0; + } + if (supply->priv->is_power_supply) ret = up_device_supply_refresh_battery (supply, &state); else |