[gnome-power-manager] Do not show empty devices in the status area tooltip



commit 75a82667d1c9de8056b7f1c0e2a8f920d7a5cf15
Author: Richard Hughes <richard hughsie com>
Date:   Fri Apr 2 22:15:31 2010 +0100

    Do not show empty devices in the status area tooltip

 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 7da1f57..5e334da 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -236,6 +236,7 @@ gpm_engine_get_summary (GpmEngine *engine)
 	guint i;
 	GPtrArray *array;
 	UpDevice *device;
+	UpDeviceState state;
 	GString *tooltip = NULL;
 	gchar *part;
 	gboolean is_present;
@@ -249,9 +250,14 @@ gpm_engine_get_summary (GpmEngine *engine)
 	array = engine->priv->array;
 	for (i=0;i<array->len;i++) {
 		device = g_ptr_array_index (engine->priv->array, i);
-		g_object_get (device, "is-present", &is_present, NULL);
+		g_object_get (device,
+			      "is-present", &is_present,
+			      "state", &state,
+			      NULL);
 		if (!is_present)
 			continue;
+		if (state == UP_DEVICE_STATE_EMPTY)
+			continue;
 		part = gpm_upower_get_device_summary (device);
 		if (part != NULL)
 			g_string_append_printf (tooltip, "%s\n", part);



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