[gnome-color-manager] trivial: do not send ::changed in GcmDevice if there was no change



commit 13cd4515bc60509daeed97358c35b1de1044f4c0
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 24 12:28:06 2010 +0000

    trivial: do not send ::changed in GcmDevice if there was no change
    
    This reduces wakeups, and will be good for power saving

 src/gcm-device.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-device.c b/src/gcm-device.c
index cdac153..ffb241a 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -216,8 +216,10 @@ void
 gcm_device_set_kind (GcmDevice *device, GcmDeviceTypeEnum kind)
 {
 	g_return_if_fail (GCM_IS_DEVICE (device));
-	device->priv->type = kind;
-	gcm_device_changed (device);
+	if (device->priv->type != kind) {
+		device->priv->type = kind;
+		gcm_device_changed (device);
+	}
 }
 
 /**
@@ -237,8 +239,10 @@ void
 gcm_device_set_connected (GcmDevice *device, gboolean connected)
 {
 	g_return_if_fail (GCM_IS_DEVICE (device));
-	device->priv->connected = connected;
-	gcm_device_changed (device);
+	if (device->priv->connected != connected) {
+		device->priv->connected = connected;
+		gcm_device_changed (device);
+	}
 }
 
 /**



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