[gnome-color-manager] Properly detect broken dispcal output. Fixes #605838



commit 09b018124566eb54300e47ae0cb28e1ac0fc73b3
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jan 1 11:27:23 2010 +0000

    Properly detect broken dispcal output. Fixes #605838

 src/gcm-calibrate-argyll.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 222ad5d..1dcce7f 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -95,6 +95,12 @@ gcm_calibrate_argyll_get_display (const gchar *output_name, GError **error)
 	/* split it into lines */
 	split = g_strsplit (data, "\n", -1);
 	for (i=0; split[i] != NULL; i++) {
+		if (g_strstr_len (split[i], -1, "XRandR 1.2 is faulty") != NULL) {
+			ret = FALSE;
+			if (error != NULL)
+				*error = g_error_new (1, 0, "failed to match display as RandR is faulty");
+			goto out;
+		}
 		name = g_strdup (split[i]);
 		g_strdelimit (name, " ", '\0');
 		if (g_strcmp0 (output_name, &name[26]) == 0) {
@@ -106,8 +112,10 @@ gcm_calibrate_argyll_get_display (const gchar *output_name, GError **error)
 
 	/* nothing found */
 	if (display == G_MAXUINT) {
+		ret = FALSE;
 		if (error != NULL)
 			*error = g_error_new (1, 0, "failed to match display");
+		goto out;
 	}
 out:
 	g_free (data);
@@ -123,7 +131,6 @@ gcm_calibrate_argyll_get_display_type (GcmCalibrateArgyll *calibrate_argyll)
 {
 	gboolean is_lcd;
 	gboolean is_crt;
-//	GcmCalibrateArgyllPrivate *priv = calibrate_argyll->priv;
 
 	g_object_get (calibrate_argyll,
 		      "is-lcd", &is_lcd,



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