[gnome-power-manager] trivial: allow non-battery devices to be used for gpm_engine_update_composite_device()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] trivial: allow non-battery devices to be used for gpm_engine_update_composite_device()
- Date: Fri, 2 Apr 2010 21:17:30 +0000 (UTC)
commit 282889142332319af67831c88aae85d727d7cadc
Author: Richard Hughes <richard hughsie com>
Date: Fri Apr 2 21:34:27 2010 +0100
trivial: allow non-battery devices to be used for gpm_engine_update_composite_device()
src/gpm-engine.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index f9e628a..b0b24a6 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -627,12 +627,18 @@ gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device
UpDevice *device;
UpDeviceState state;
UpDeviceKind kind;
+ UpDeviceKind original_kind;
gboolean debug;
gchar *text;
/* are we printing to console? */
debug = egg_debug_enabled ();
+ /* get the type of the original device */
+ g_object_get (original_device,
+ "kind", &original_kind,
+ NULL);
+
/* update the composite device */
array = engine->priv->array;
for (i=0;i<array->len;i++) {
@@ -644,7 +650,7 @@ gpm_engine_update_composite_device (GpmEngine *engine, UpDevice *original_device
"energy-full", &energy_full,
"energy-rate", &energy_rate,
NULL);
- if (kind != UP_DEVICE_KIND_BATTERY)
+ if (kind != original_kind)
continue;
if (debug) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]