mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-05 13:30:28 +01:00
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.
This commit is contained in:
parent
9ce7b4408f
commit
feea39fa43
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue