[gnome-power-manager] Use the composite device for getting the global system warning icon



commit 7eeb615e019af8783f037dd94e34dfee3dd36ce5
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 16 09:18:33 2009 +0100

    Use the composite device for getting the global system warning icon

 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 7bea336..dc8de76 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -88,6 +88,8 @@ static gpointer gpm_engine_object = NULL;
 
 G_DEFINE_TYPE (GpmEngine, gpm_engine, G_TYPE_OBJECT)
 
+static DkpDevice *gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_device);
+
 typedef enum {
 	GPM_ENGINE_WARNING_NONE = 0,
 	GPM_ENGINE_WARNING_DISCHARGING = 1,
@@ -290,6 +292,10 @@ gpm_engine_get_icon_priv (GpmEngine *engine, DkpDeviceType device_type, GpmEngin
 			      "is-present", &is_present,
 			      NULL);
 
+		/* if battery then use composite device to cope with multiple batteries */
+		if (type == DKP_DEVICE_TYPE_BATTERY)
+			device = gpm_engine_update_composite_device (engine, device);
+
 		warning_temp = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(device), "engine-warning-old"));
 		if (type == device_type && is_present) {
 			if (warning != GPM_ENGINE_WARNING_NONE) {



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