[gnome-power-manager] Only print the DeviceKit device if we are using --verbose



commit c0eb29cbf83c708a8e85cfd1edcd866eb4bd3be8
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jul 2 11:13:16 2009 +0100

    Only print the DeviceKit device if we are using --verbose

 src/gpm-engine.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index d7b25f0..4bc090b 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -569,6 +569,10 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 	DkpDevice *device;
 	DkpDeviceState state;
 	DkpDeviceType type;
+	gboolean debug;
+
+	/* are we printing to console? */
+	debug = egg_debug_enabled ();
 
 	/* update the composite device */
 	array = engine->priv->array;
@@ -584,8 +588,10 @@ gpm_engine_update_composite_device (GpmEngine *engine, DkpDevice *original_devic
 		if (type != DKP_DEVICE_TYPE_BATTERY)
 			continue;
 
-		egg_debug ("printing device %i", i);
-		dkp_device_print (device);
+		if (debug) {
+			egg_debug ("printing device %i", i);
+			dkp_device_print (device);
+		}
 
 		/* one of these will be charging or discharging */
 		if (state == DKP_DEVICE_STATE_CHARGING)



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