Commit 88e384e3 authored by Bastien Nocera's avatar Bastien Nocera
Browse files

power: Remove "on AC" check from warning-levels

UPower already does this for us, to avoid warning levels being set
when the batteries didn't notice the AC yet.
parent 530cd007
......@@ -414,14 +414,6 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
"icon-name", &icon_name,
NULL);
/* check to see if the batteries have not noticed we are on AC */
if (kind == UP_DEVICE_KIND_BATTERY) {
if (!up_client_get_on_battery (manager->priv->up_client)) {
g_warning ("ignoring critically low message as we are not on battery power");
goto out;
}
}
if (kind == UP_DEVICE_KIND_BATTERY) {
/* if the user has no other batteries, drop the "Laptop" wording */
......@@ -527,7 +519,6 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Battery is low"), NULL);
out:
g_free (icon_name);
g_free (message);
}
......@@ -552,14 +543,6 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
"icon-name", &icon_name,
NULL);
/* check to see if the batteries have not noticed we are on AC */
if (kind == UP_DEVICE_KIND_BATTERY) {
if (!up_client_get_on_battery (manager->priv->up_client)) {
g_warning ("ignoring low message as we are not on battery power");
goto out;
}
}
if (kind == UP_DEVICE_KIND_BATTERY) {
/* if the user has no other batteries, drop the "Laptop" wording */
......@@ -697,7 +680,7 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
break;
}
out:
g_free (icon_name);
g_free (message);
}
......@@ -718,14 +701,6 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device)
"icon-name", &icon_name,
NULL);
/* check to see if the batteries have not noticed we are on AC */
if (kind == UP_DEVICE_KIND_BATTERY) {
if (!up_client_get_on_battery (manager->priv->up_client)) {
g_warning ("ignoring critically low message as we are not on battery power");
goto out;
}
}
if (kind == UP_DEVICE_KIND_BATTERY) {
/* TRANSLATORS: laptop battery is really, really, low */
......@@ -803,7 +778,7 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device)
CA_PROP_EVENT_ID, "battery-caution",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
out:
g_free (icon_name);
g_free (message);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment