summaryrefslogtreecommitdiff
path: root/src/gpm-engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpm-engine.c')
-rw-r--r--src/gpm-engine.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index 49f39fd..6f16381 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -611,8 +611,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++) {
@@ -620,7 +626,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++;
}
@@ -675,12 +681,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++) {
@@ -692,7 +704,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) {