[gnome-color-manager] Include the sensor type in the profile metadata



commit fd02c23f7d6b675b926d06fc78591b2558760adf
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jan 12 13:02:00 2012 +0000

    Include the sensor type in the profile metadata

 src/gcm-calibrate-main.c |    9 +++++++--
 src/gcm-utils.h          |    4 ++++
 src/gcm-viewer.c         |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-calibrate-main.c b/src/gcm-calibrate-main.c
index ef3b1a6..2c5d0fd 100644
--- a/src/gcm-calibrate-main.c
+++ b/src/gcm-calibrate-main.c
@@ -272,7 +272,9 @@ out:
 }
 
 static gboolean
-gcm_calib_set_extra_metadata (const gchar *filename, GError **error)
+gcm_calib_set_extra_metadata (GcmCalibratePriv *calib,
+			      const gchar *filename,
+			      GError **error)
 {
 	cmsHANDLE dict = NULL;
 	cmsHPROFILE lcms_profile;
@@ -306,6 +308,9 @@ gcm_calib_set_extra_metadata (const gchar *filename, GError **error)
 	_cmsDictAddEntryAscii (dict,
 			       CD_PROFILE_METADATA_DATA_SOURCE,
 			       CD_PROFILE_METADATA_DATA_SOURCE_CALIB);
+	_cmsDictAddEntryAscii (dict,
+			       CD_PROFILE_METADATA_MEASUREMENT_DEVICE,
+			       cd_sensor_kind_to_string (cd_sensor_get_kind (calib->sensor)));
 
 	/* just write dict */
 	ret = cmsWriteTag (lcms_profile, cmsSigMetaTag, dict);
@@ -374,7 +379,7 @@ gcm_calib_start_idle_cb (gpointer user_data)
 	}
 
 	/* set some private properties */
-	ret = gcm_calib_set_extra_metadata (filename, &error);
+	ret = gcm_calib_set_extra_metadata (calib, filename, &error);
 	if (!ret) {
 		g_warning ("failed to set extra metadata: %s",
 			   error->message);
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 19d3a9a..9438305 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -32,6 +32,10 @@
 #define GCM_DBUS_INTERFACE				"org.gnome.ColorManager"
 #define GCM_DBUS_PATH					"/org/gnome/ColorManager"
 
+#ifndef CD_PROFILE_METADATA_MEASUREMENT_DEVICE
+#define CD_PROFILE_METADATA_MEASUREMENT_DEVICE		"MEASUREMENT_device"
+#endif
+
 /* DISTROS: you will have to patch if you have changed the name of these packages */
 #define GCM_PREFS_PACKAGE_NAME_SHARED_COLOR_TARGETS	"shared-color-targets"
 #define GCM_PREFS_PACKAGE_NAME_ARGYLLCMS		"argyllcms"
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index ec778c0..037a818 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -777,6 +777,7 @@ struct {
 	{ CD_PROFILE_METADATA_DATA_SOURCE,		N_("Data source type") },
 	{ CD_PROFILE_METADATA_MAPPING_FORMAT,		N_("Mapping format") },
 	{ CD_PROFILE_METADATA_MAPPING_QUALIFIER,	N_("Mapping qualifier") },
+	{ CD_PROFILE_METADATA_MEASUREMENT_DEVICE,	N_("Calibration device") },
 	{ NULL, NULL }
 };
 



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