[gnome-power-manager] Do not set a charge warning if the device is on AC



commit 940bdebf1f0ecb039b255d0bd0a4236f8188fdd4
Author: Pramod Dematagoda <pmd lotr gandalf gmail com>
Date:   Thu Mar 4 10:54:13 2010 +0530

    Do not set a charge warning if the device is on AC

 src/gpm-engine.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index d244219..c768b2e 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -191,6 +191,10 @@ gpm_engine_get_warning (GpmEngine *engine, DkpDevice *device)
 	/* default to no engine */
 	warning_type = GPM_ENGINE_WARNING_NONE;
 
+	/* if the device in question is on ac, don't give a warning */
+	if (state == DKP_DEVICE_STATE_CHARGING)
+		goto out;
+
 	if (type == DKP_DEVICE_TYPE_MOUSE ||
 	    type == DKP_DEVICE_TYPE_KEYBOARD) {
 
@@ -218,6 +222,8 @@ gpm_engine_get_warning (GpmEngine *engine, DkpDevice *device)
 		if (state == DKP_DEVICE_STATE_DISCHARGING)
 			warning_type = GPM_ENGINE_WARNING_DISCHARGING;
 	}
+
+ out:
 	return warning_type;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]