[gnome-color-manager] trivial: adapt gcm-picker to the new colord async API



commit f71e6f7b186d6e7c991c98f0a24a2de4653e8608
Author: Richard Hughes <richard hughsie com>
Date:   Mon May 30 22:49:38 2011 +0100

    trivial: adapt gcm-picker to the new colord async API

 src/gcm-picker.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-picker.c b/src/gcm-picker.c
index ec3c9af..75764ea 100644
--- a/src/gcm-picker.c
+++ b/src/gcm-picker.c
@@ -534,6 +534,7 @@ gcm_prefs_setup_space_combobox (GtkWidget *widget)
 	gboolean has_profile = FALSE;
 	gboolean has_vcgt;
 	gchar *text = NULL;
+	gboolean ret;
 	GError *error = NULL;
 	GPtrArray *devices = NULL;
 	GPtrArray *profile_array = NULL;
@@ -556,6 +557,15 @@ gcm_prefs_setup_space_combobox (GtkWidget *widget)
 	for (i=0; i<profile_array->len; i++) {
 		profile = g_ptr_array_index (profile_array, i);
 
+		/* connect to the profile */
+		ret = cd_profile_connect_sync (profile, NULL, &error);
+		if (!ret) {
+			g_warning ("failed to connect to profile: %s",
+				   error->message);
+			g_error_free (error);
+			goto out;
+		}
+
 		/* only for correct kind */
 		has_vcgt = cd_profile_get_has_vcgt (profile);
 		has_colorspace_description = gcm_profile_has_colorspace_description (profile);
@@ -579,10 +589,29 @@ gcm_prefs_setup_space_combobox (GtkWidget *widget)
 						      &error);
 	for (i=0; i<devices->len; i++) {
 		device_tmp = g_ptr_array_index (devices, i);
+
+		/* connect to the device */
+		ret = cd_device_connect_sync (device_tmp, NULL, &error);
+		if (!ret) {
+			g_warning ("failed to connect to device: %s",
+				   error->message);
+			g_error_free (error);
+			goto out;
+		}
+
 		profile = cd_device_get_default_profile (device_tmp);
 		if (profile == NULL)
 			continue;
 
+		/* connect to the profile */
+		ret = cd_profile_connect_sync (profile, NULL, &error);
+		if (!ret) {
+			g_warning ("failed to connect to profile: %s",
+				   error->message);
+			g_error_free (error);
+			goto out;
+		}
+
 		/* add device profile */
 		gcm_prefs_combobox_add_profile (widget, profile, NULL);
 		g_object_unref (profile);



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