[gnome-color-manager] Improve some error handling for invalid EDID displays



commit 79939a6c960560fe69c3eae85424eb1791282adc
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 5 11:57:14 2009 +0000

    Improve some error handling for invalid EDID displays

 src/gcm-calibrate.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index f5be9b9..5366e7e 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -297,7 +297,7 @@ gcm_calibrate_debug_argv (const gchar *program, gchar **argv)
 static gboolean
 gcm_calibrate_task_neutralise (GcmCalibrate *calibrate, GError **error)
 {
-	gboolean ret = TRUE;
+	gboolean ret = FALSE;
 	GcmCalibratePrivate *priv = calibrate->priv;
 	gchar type;
 	gchar **argv = NULL;
@@ -315,14 +315,18 @@ gcm_calibrate_task_neutralise (GcmCalibrate *calibrate, GError **error)
 	/* get the device */
 	output = gnome_rr_screen_get_output_by_name (priv->rr_screen, priv->output_name);
 	if (output == NULL) {
-		egg_warning ("failed to get output");
+		if (error != NULL)
+			*error = g_error_new (1, 0, "failed to get output for %s", priv->output_name);
 		goto out;
 	}
 
 	/* get edid */
 	data = gnome_rr_output_get_edid_data (output);
-	if (data == NULL)
+	if (data == NULL) {
+		if (error != NULL)
+			*error = g_error_new (1, 0, "failed to get EDID for %s", priv->output_name);
 		goto out;
+	}
 
 	/* parse edid */
 	ret = gcm_edid_parse (priv->edid, data, error);



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