[gnome-settings-daemon] power: Remove "on AC" check from warning-levels
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Remove "on AC" check from warning-levels
- Date: Thu, 17 Oct 2013 15:43:59 +0000 (UTC)
commit 88e384e32627d0ba1239883b65442f4952ffb47e
Author: Bastien Nocera <hadess hadess net>
Date: Thu Oct 17 11:53:13 2013 +0200
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.
plugins/power/gsd-power-manager.c | 29 ++---------------------------
1 files changed, 2 insertions(+), 27 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 96cb4b5..d144659 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]