color: Don't show profile ages for EDID, test and colorspace profiles

Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=661669
This commit is contained in:
Richard Hughes 2011-10-13 16:28:19 +01:00
parent 9e1fa3c900
commit d25fe273d2

View file

@ -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, "<span foreground='gray'><i>");
g_string_append (date_tmp, "</i></span>");
}
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 */