[gnome-power-manager] Ignore capacity readings of less than 1%
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-power-manager] Ignore capacity readings of less than 1%
- Date: Sun, 14 Jun 2009 15:11:52 -0400 (EDT)
commit 6db1a476c058fa5d38a8ad33d2f0ddfaf3785334
Author: Richard Hughes <richard hughsie com>
Date: Sun Jun 14 14:22:29 2009 +0100
Ignore capacity readings of less than 1%
src/gpm-engine.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index d2437cc..56314f5 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -520,7 +520,16 @@ gpm_engine_device_check_capacity (GpmEngine *engine, DkpDevice *device)
"capacity", &capacity,
NULL);
- if (type != DKP_DEVICE_TYPE_BATTERY || capacity > 50.0f)
+ /* not laptop battery */
+ if (type != DKP_DEVICE_TYPE_BATTERY)
+ return FALSE;
+
+ /* capacity okay */
+ if (capacity > 50.0f)
+ return FALSE;
+
+ /* capacity invalid */
+ if (capacity < 1.0f)
return FALSE;
/* only emit this if specified in gconf */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]