[gnome-color-manager] trivial: Add some trivial debugging trying to find a problem



commit 195d55efce947a013b64b1c79bd97d725ff99c01
Author: Richard Hughes <richard hughsie com>
Date:   Fri Nov 27 16:50:38 2009 +0000

    trivial: Add some trivial debugging trying to find a problem

 data/gnome-color-manager.schemas.in |    2 +-
 src/gcm-apply.c                     |    1 +
 src/gcm-clut.c                      |   11 +++++++----
 src/gcm-device.c                    |   11 +++++++----
 src/gcm-prefs.c                     |    2 ++
 src/gcm-profile.c                   |    9 ++++++++-
 6 files changed, 26 insertions(+), 10 deletions(-)
---
diff --git a/data/gnome-color-manager.schemas.in b/data/gnome-color-manager.schemas.in
index 30017a5..3cbade6 100644
--- a/data/gnome-color-manager.schemas.in
+++ b/data/gnome-color-manager.schemas.in
@@ -46,7 +46,7 @@
       <applyto>/apps/gnome-color-manager/output_intent</applyto>
       <owner>gnome-color-manager</owner>
       <type>string</type>
-      <default>true</default>
+      <default>perceptual</default>
       <locale name="C">
         <short>The output intent to use, e.g. 'perceptual'.</short>
         <long>The output intent to use, e.g. 'perceptual'.</long>
diff --git a/src/gcm-apply.c b/src/gcm-apply.c
index f4858bb..937e0f2 100644
--- a/src/gcm-apply.c
+++ b/src/gcm-apply.c
@@ -83,6 +83,7 @@ main (int argc, char **argv)
 			continue;
 
 		/* set gamma for device */
+		egg_debug ("setting %s gamma", gcm_device_get_id (device));
 		ret = gcm_utils_set_gamma_for_device (device, &error);
 		if (!ret) {
 			retval = 1;
diff --git a/src/gcm-clut.c b/src/gcm-clut.c
index 1afa491..1ef0ca5 100644
--- a/src/gcm-clut.c
+++ b/src/gcm-clut.c
@@ -415,15 +415,18 @@ gcm_clut_class_init (GcmClutClass *klass)
 static void
 gcm_clut_init (GcmClut *clut)
 {
+	GError *error = NULL;
 	clut->priv = GCM_CLUT_GET_PRIVATE (clut);
 	clut->priv->array = g_ptr_array_new_with_free_func (g_free);
 	clut->priv->profile = NULL;
 	clut->priv->gconf_client = gconf_client_get_default ();
-	clut->priv->gamma = gconf_client_get_float (clut->priv->gconf_client, GCM_SETTINGS_DEFAULT_GAMMA, NULL);
-	if (clut->priv->gamma < 0.1f) {
-		egg_warning ("failed to get setup parameters");
-		clut->priv->gamma = 1.0f;
+	clut->priv->gamma = gconf_client_get_float (clut->priv->gconf_client, GCM_SETTINGS_DEFAULT_GAMMA, &error);
+	if (error != NULL) {
+		egg_warning ("failed to get setup parameters: %s", error->message);
+		g_error_free (error);
 	}
+	if (clut->priv->gamma < 0.01)
+		clut->priv->gamma = 1.0f;
 	clut->priv->brightness = 0.0f;
 	clut->priv->contrast = 100.f;
 }
diff --git a/src/gcm-device.c b/src/gcm-device.c
index 5e7fc24..2cb49ef 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -671,6 +671,7 @@ gcm_device_class_init (GcmDeviceClass *klass)
 static void
 gcm_device_init (GcmDevice *device)
 {
+	GError *error = NULL;
 	device->priv = GCM_DEVICE_GET_PRIVATE (device);
 	device->priv->id = NULL;
 	device->priv->serial = NULL;
@@ -680,11 +681,13 @@ gcm_device_init (GcmDevice *device)
 	device->priv->native_device_sysfs = NULL;
 	device->priv->profile_filename = NULL;
 	device->priv->gconf_client = gconf_client_get_default ();
-	device->priv->gamma = gconf_client_get_float (device->priv->gconf_client, "/apps/gnome-color-manager/default_gamma", NULL);
-	if (device->priv->gamma < 0.1f) {
-		egg_warning ("failed to get setup parameters");
-		device->priv->gamma = 1.0f;
+	device->priv->gamma = gconf_client_get_float (device->priv->gconf_client, GCM_SETTINGS_DEFAULT_GAMMA, &error);
+	if (error != NULL) {
+		egg_warning ("failed to get setup parameters: %s", error->message);
+		g_error_free (error);
 	}
+	if (device->priv->gamma < 0.01)
+		device->priv->gamma = 1.0f;
 	device->priv->brightness = 0.0f;
 	device->priv->contrast = 100.f;
 }
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index e1b4cc5..973a42d 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -882,6 +882,7 @@ gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer use
 
 	/* set correct profile */
 	if (profile_filename == NULL) {
+		egg_debug ("no profile selected");
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "combobox_profile"));
 		gtk_combo_box_set_active (GTK_COMBO_BOX (widget), profiles_array->len);
 	} else {
@@ -903,6 +904,7 @@ gcm_prefs_devices_treeview_clicked_cb (GtkTreeSelection *selection, gpointer use
 
 	/* failed to find profile in combobox */
 	if (!ret) {
+		egg_warning ("failed to find profile: %s", profile_filename);
 		widget = GTK_WIDGET (gtk_builder_get_object (builder, "combobox_profile"));
 		gtk_combo_box_set_active (GTK_COMBO_BOX (widget), profiles_array_in_combo->len);
 	}
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 25d658f..df25618 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -590,11 +590,18 @@ gcm_profile_parse_data (GcmProfile *profile, const gchar *data, gsize length, GE
 	egg_debug ("number of tags: %i", num_tags);
 
 	for (i=0; i<num_tags; i++) {
+		const gchar *tag_description;
 		offset = GCM_TAG_WIDTH * i;
 		tag_id = gcm_parser_unencode_32 (data, GCM_BODY + offset + GCM_TAG_ID);
 		tag_offset = gcm_parser_unencode_32 (data, GCM_BODY + offset + GCM_TAG_OFFSET);
 		tag_size = gcm_parser_unencode_32 (data, GCM_BODY + offset + GCM_TAG_SIZE);
-		egg_debug ("tag %x (%s) is present at %u with size %u", tag_id, gcm_prefs_get_tag_description (tag_id), offset, tag_size);
+
+		/* get description */
+		tag_description = gcm_prefs_get_tag_description (tag_id);
+		if (tag_description == NULL)
+			egg_debug ("unknown tag %x is present at %u with size %u", tag_id, offset, tag_size);
+		else
+			egg_debug ("named tag %x [%s] is present at %u with size %u", tag_id, tag_description, offset, tag_size);
 
 		if (tag_id == GCM_TAG_ID_PROFILE_DESCRIPTION) {
 			egg_debug ("found DESC: %s", data+tag_offset+12);



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