summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2011-03-31 11:19:14 +0100
committerRichard Hughes <richard@hughsie.com>2011-03-31 11:19:14 +0100
commitfa02c5d197b8cf408749a0e6383cd704e1882cee (patch)
treeb6cc40dea49326d4214632ae79ba508fa4be2c05
parent2c18669e95b2e2004599346cc9f5f23eeaebbf1c (diff)
downloadcolord-fa02c5d197b8cf408749a0e6383cd704e1882cee.tar.gz
trivial: Add the cd_profile_get_metadata_item() helper to CdProfile
-rw-r--r--libcolord/cd-profile.c17
-rw-r--r--libcolord/cd-profile.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/libcolord/cd-profile.c b/libcolord/cd-profile.c
index d015f0c..ab3b542 100644
--- a/libcolord/cd-profile.c
+++ b/libcolord/cd-profile.c
@@ -275,6 +275,23 @@ cd_profile_get_metadata (CdProfile *profile)
return g_hash_table_ref (profile->priv->metadata);
}
+/**
+ * cd_profile_get_metadata_item:
+ * @profile: a #CdProfile instance.
+ * @key: a key for the metadata dictionary
+ *
+ * Returns the profile metadata for a specific key.
+ *
+ * Return value: the metadata value, or %NULL if not set.
+ *
+ * Since: 0.1.5
+ **/
+const gchar *
+cd_profile_get_metadata_item (CdProfile *profile, const gchar *key)
+{
+ g_return_val_if_fail (CD_IS_PROFILE (profile), NULL);
+ return g_hash_table_lookup (profile->priv->metadata, key);
+}
/**
* cd_profile_set_metadata_from_variant:
diff --git a/libcolord/cd-profile.h b/libcolord/cd-profile.h
index 063bc1a..c28a706 100644
--- a/libcolord/cd-profile.h
+++ b/libcolord/cd-profile.h
@@ -108,6 +108,8 @@ CdColorspace cd_profile_get_colorspace (CdProfile *profile);
gboolean cd_profile_get_has_vcgt (CdProfile *profile);
gboolean cd_profile_get_is_system_wide (CdProfile *profile);
GHashTable *cd_profile_get_metadata (CdProfile *profile);
+const gchar *cd_profile_get_metadata_item (CdProfile *profile,
+ const gchar *key);
G_END_DECLS