[gnome-power-manager] Don't treat percentage=0 as error condition
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] Don't treat percentage=0 as error condition
- Date: Tue, 30 Mar 2010 09:37:20 +0000 (UTC)
commit 8729360ab87cda53329e32d33cebef96de3f140f
Author: Chow Loong Jin <hyperair ubuntu com>
Date: Thu Mar 25 21:12:14 2010 +0800
Don't treat percentage=0 as error condition
On some (broken) battery controllers, the percentage drops to 0 just
before the battery runs out. Rather than ignoring it, we should run the
critical percentage policy action anyway.
src/gpm-engine.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
---
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index c768b2e..e0ce38c 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -123,11 +123,6 @@ gpm_engine_get_warning_percentage (GpmEngine *engine, DkpDevice *device)
/* get device properties */
g_object_get (device, "percentage", &percentage, NULL);
- /* this is probably an error condition */
- if (percentage == 0) {
- egg_warning ("percentage zero, something's gone wrong");
- return GPM_ENGINE_WARNING_NONE;
- }
if (percentage <= engine->priv->action_percentage)
return GPM_ENGINE_WARNING_ACTION;
if (percentage <= engine->priv->critical_percentage)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]