[gnome-color-manager] trivial: fix up an error in the last commit, so that if filename is not set we skip the load



commit 64037aacc1ba6fa7bfa53deabc00dca57cdd658d
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 10 08:05:25 2009 +0000

    trivial: fix up an error in the last commit, so that if filename is not set we skip the load

 src/gcm-utils.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 223193a..a7e9adf 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -287,6 +287,9 @@ gcm_utils_set_gamma_for_device (GcmDevice *device, GError **error)
 
 	/* create CLUT */
 	clut = gcm_clut_new ();
+	g_object_set (clut,
+		      "size", size,
+		      NULL);
 
 	/* only set the CLUT if we're not seting the atom */
 	use_global = gconf_client_get_bool (gconf_client, GCM_SETTINGS_GLOBAL_DISPLAY_CORRECTION, NULL);
@@ -295,18 +298,14 @@ gcm_utils_set_gamma_for_device (GcmDevice *device, GError **error)
 			      "gamma", gamma,
 			      "brightness", brightness,
 			      "contrast", contrast,
-			      "size", size,
 			      NULL);
 
 		/* load this new profile */
-		ret = gcm_clut_load_from_profile (clut, profile, error);
-		if (!ret)
-			goto out;
-	} else {
-		/* we're using a dummy clut */
-		g_object_set (clut,
-			      "size", size,
-			      NULL);
+		if (profile != NULL) {
+			ret = gcm_clut_load_from_profile (clut, profile, error);
+			if (!ret)
+				goto out;
+		}
 	}
 
 	/* actually set the gamma */



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