From d25fe273d2d60e0129940dbc82706527dcfc30db Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 13 Oct 2011 16:28:19 +0100 Subject: [PATCH] color: Don't show profile ages for EDID, test and colorspace profiles Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=661669 --- panels/color/cc-color-panel.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c index 650cc3dd5..9dba50eb2 100644 --- a/panels/color/cc-color-panel.c +++ b/panels/color/cc-color-panel.c @@ -1314,21 +1314,12 @@ gcm_prefs_device_kind_to_icon_name (CdDeviceKind kind) return "image-missing"; } -static gboolean -gcm_prefs_profile_is_based_from_edid (CdProfile *profile) -{ - if (cd_profile_get_kind (profile) != CD_PROFILE_KIND_DISPLAY_DEVICE) - return FALSE; - if (cd_profile_get_metadata_item (profile, "EDID_md5") == NULL) - return FALSE; - return TRUE; -} - static GString * gcm_prefs_get_profile_age_as_string (CdProfile *profile) { + const gchar *id; gint64 age; - GString *string; + GString *string = NULL; if (profile == NULL) { @@ -1337,6 +1328,18 @@ gcm_prefs_get_profile_age_as_string (CdProfile *profile) goto out; } + /* don't show details for EDID, colorspace or test profiles */ + id = cd_profile_get_metadata_item (profile, + CD_PROFILE_METADATA_DATA_SOURCE); + if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0) + goto out; +#if CD_CHECK_VERSION(0,1,14) + if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_STANDARD) == 0) + goto out; + if (g_strcmp0 (id, CD_PROFILE_METADATA_DATA_SOURCE_TEST) == 0) + goto out; +#endif + /* days */ age = cd_profile_get_age (profile); if (age == 0) @@ -1661,8 +1664,9 @@ skip: profile_tmp = g_ptr_array_index (profiles, i); title_tmp = gcm_prefs_get_profile_title (prefs, profile_tmp); - /* don't show details for EDID profiles */ - if (gcm_prefs_profile_is_based_from_edid (profile_tmp)) + /* get profile age */ + date_tmp = gcm_prefs_get_profile_age_as_string (profile_tmp); + if (date_tmp == NULL) { /* TRANSLATORS: this is when the calibration profile age is not * specified as it has been autogenerated from the hardware */ @@ -1670,10 +1674,6 @@ skip: g_string_prepend (date_tmp, ""); g_string_append (date_tmp, ""); } - else - { - date_tmp = gcm_prefs_get_profile_age_as_string (profile_tmp); - } sort_tmp = gcm_prefs_get_profile_created_for_sort (profile_tmp); /* get an existing profile, or create a new one */