[gnome-color-manager: 73/80] Fix a crash in gcm-picker if we compiled without VTE support



commit 82d4c475cd75b535b931c9499f340494ae4147d4
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 19 09:18:32 2010 +0100

    Fix a crash in gcm-picker if we compiled without VTE support

 libcolor-glib/gcm-sensor-client.c |    2 +-
 src/gcm-calibrate-argyll.c        |   16 ++++++++++++++--
 src/gcm-picker.c                  |   11 ++++++++---
 3 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/libcolor-glib/gcm-sensor-client.c b/libcolor-glib/gcm-sensor-client.c
index 07609d9..6179fdf 100644
--- a/libcolor-glib/gcm-sensor-client.c
+++ b/libcolor-glib/gcm-sensor-client.c
@@ -165,7 +165,7 @@ gcm_sensor_client_device_add (GcmSensorClient *sensor_client, GUdevDevice *devic
 	GcmSensorClientPrivate *priv = sensor_client->priv;
 
 	/* interesting device? */
-	ret = g_udev_device_get_property_as_boolean (device, "GCM_SENSOR_CLIENT");
+	ret = g_udev_device_get_property_as_boolean (device, "GCM_COLORIMETER");
 	if (!ret)
 		goto out;
 
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 33978fb..6ecccbe 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -397,6 +397,11 @@ gcm_calibrate_argyll_fork_command (GcmCalibrateArgyll *calibrate_argyll, gchar *
 	/* we're running */
 	priv->state = GCM_CALIBRATE_ARGYLL_STATE_RUNNING;
 out:
+#else
+	g_set_error_literal (error,
+			     GCM_CALIBRATE_ERROR,
+			     GCM_CALIBRATE_ERROR_INTERNAL,
+			     "no VTE support");
 #endif
 	return ret;
 }
@@ -1457,6 +1462,7 @@ gcm_calibrate_argyll_spotread_read_chart (GcmCalibrateArgyll *calibrate_argyll,
 	/* get correct name of the command */
 	command = gcm_calibrate_argyll_get_tool_filename ("spotread", error);
 	if (command == NULL) {
+		egg_error ("moo");
 		ret = FALSE;
 		goto out;
 	}
@@ -1489,8 +1495,10 @@ gcm_calibrate_argyll_spotread_read_chart (GcmCalibrateArgyll *calibrate_argyll,
 
 	/* start up the command */
 	ret = gcm_calibrate_argyll_fork_command (calibrate_argyll, argv, error);
-	if (!ret)
+	if (!ret) {
+		egg_error ("moo");
 		goto out;
+	}
 
 	/* wait until finished */
 	g_main_loop_run (priv->loop);
@@ -1502,6 +1510,7 @@ gcm_calibrate_argyll_spotread_read_chart (GcmCalibrateArgyll *calibrate_argyll,
 				     GCM_CALIBRATE_ERROR_USER_ABORT,
 				     "calibration was cancelled");
 		ret = FALSE;
+		egg_error ("moo");
 		goto out;
 	}
 #ifdef HAVE_VTE
@@ -1514,6 +1523,7 @@ gcm_calibrate_argyll_spotread_read_chart (GcmCalibrateArgyll *calibrate_argyll,
 			     "command failed to run successfully: %s", vte_text);
 		g_free (vte_text);
 		ret = FALSE;
+		egg_error ("moo");
 		goto out;
 	}
 #endif
@@ -1541,8 +1551,10 @@ gcm_calibrate_argyll_spotread (GcmCalibrate *calibrate, GtkWindow *window, GErro
 
 	/* step 3 */
 	ret = gcm_calibrate_argyll_spotread_read_chart (calibrate_argyll, error);
-	if (!ret)
+	if (!ret) {
+		egg_error ("moo");
 		goto out;
+	}
 
 	/* step 5 */
 	ret = gcm_calibrate_argyll_remove_temp_files (calibrate_argyll, error);
diff --git a/src/gcm-picker.c b/src/gcm-picker.c
index 45ab5cd..358b5ce 100644
--- a/src/gcm-picker.c
+++ b/src/gcm-picker.c
@@ -266,11 +266,17 @@ gcm_picker_sensor_client_setup_ui (GcmSensorClient *sensor_client)
 	gboolean ret = FALSE;
 	GtkWidget *widget;
 
+#ifndef HAVE_VTE
+	/* TRANSLATORS: this is displayed if VTE support is not enabled */
+	gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("This application was compiled without VTE support."));
+	goto out;
+#endif
+
 	/* no present */
 	present = gcm_sensor_client_get_present (sensor_client);
 	if (!present) {
 		/* TRANSLATORS: this is displayed the user has not got suitable hardware */
-		gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("No sensor_client is attached."));
+		gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("No colorimeter is attached."));
 		goto out;
 	}
 
@@ -281,8 +287,7 @@ gcm_picker_sensor_client_setup_ui (GcmSensorClient *sensor_client)
 	/* change the label */
 	if (present && !supports_spot) {
 		/* TRANSLATORS: this is displayed the user has not got suitable hardware */
-		gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("The attached sensor_client is not capable of reading a spot color."));
-	} else if (!present) {
+		gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("The attached colorimeter is not capable of reading a spot color."));
 	}
 
 out:



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