[gnome-control-center] color: Don't show profile ages for EDID, test and colorspace profiles
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] color: Don't show profile ages for EDID, test and colorspace profiles
- Date: Thu, 13 Oct 2011 15:29:22 +0000 (UTC)
commit d25fe273d2d60e0129940dbc82706527dcfc30db
Author: Richard Hughes <richard hughsie com>
Date: Thu Oct 13 16:28:19 2011 +0100
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 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index 650cc3d..9dba50e 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, "<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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]