[gnome-power-manager] trivial: allow non-battery devices to be used for gpm_engine_get_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_get_composite_device()
- Date: Fri, 2 Apr 2010 21:17:35 +0000 (UTC)
commit 9b4825bf5d3193b596efe71df7ed72a52d2e18e8
Author: Richard Hughes <richard hughsie com>
Date: Fri Apr 2 21:37:02 2010 +0100
trivial: allow non-battery devices to be used for gpm_engine_get_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 b0b24a6..7da1f57 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -576,8 +576,14 @@ gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device)
GPtrArray *array;
UpDevice *device;
UpDeviceKind kind;
+ UpDeviceKind original_kind;
guint i;
+ /* get the type of the original device */
+ g_object_get (original_device,
+ "kind", &original_kind,
+ NULL);
+
/* find out how many batteries in the system */
array = engine->priv->array;
for (i=0;i<array->len;i++) {
@@ -585,7 +591,7 @@ gpm_engine_get_composite_device (GpmEngine *engine, UpDevice *original_device)
g_object_get (device,
"kind", &kind,
NULL);
- if (kind == UP_DEVICE_KIND_BATTERY)
+ if (kind == original_kind)
battery_devices++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]