[gnome-color-manager] Add an ICC profile metadata blacklist to avoid showing crap in the UI
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] Add an ICC profile metadata blacklist to avoid showing crap in the UI
- Date: Mon, 26 Sep 2011 21:52:51 +0000 (UTC)
commit db3cfc5e29a21cd6a8fc643080de1c4734b66374
Author: Richard Hughes <richard hughsie com>
Date: Mon Sep 26 22:52:26 2011 +0100
Add an ICC profile metadata blacklist to avoid showing crap in the UI
src/gcm-viewer.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 0822095..6aa9693 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -721,6 +721,33 @@ gcm_viewer_get_localised_metadata_key (const gchar *key)
return key;
}
+/* other CMS's add keys that we don't want to show */
+static gboolean
+gcm_viewer_is_blacklisted_metadata_key (const gchar *key)
+{
+ guint i;
+ const gchar *blacklist[] = { "prefix",
+ "EDID_blue_x",
+ "EDID_blue_y",
+ "EDID_date",
+ "EDID_gamma",
+ "EDID_green_x",
+ "EDID_green_y",
+ "EDID_mnft_id",
+ "EDID_model_id",
+ "EDID_red_x",
+ "EDID_red_y",
+ "EDID_white_x",
+ "EDID_white_y",
+ "vcgt",
+ NULL };
+ for (i = 0; blacklist[i] != NULL; i++) {
+ if (g_strcmp0 (blacklist[i], key) == 0)
+ return FALSE;
+ }
+ return TRUE;
+}
+
/**
* gcm_viewer_add_metadata:
**/
@@ -753,6 +780,9 @@ gcm_viewer_add_metadata (GcmViewerPrivate *viewer,
if (keys == NULL)
goto out;
for (l = keys; l != NULL; l = l->next) {
+ ret = gcm_viewer_is_blacklisted_metadata_key (l->data);
+ if (!ret)
+ continue;
key = gcm_viewer_get_localised_metadata_key ((gchar *) l->data);
value = g_hash_table_lookup (metadata, l->data);
g_debug ("Adding '%s', '%s'",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]