summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2013-04-24 21:47:14 +0100
committerRichard Hughes <richard@hughsie.com>2013-04-24 21:47:14 +0100
commit87be4ed4411ca90b00509a42e64db3aa7d6dba5c (patch)
tree5312a6abe13e7e52abf4e879cfb7066f67c275fc
parent08f489d5c56130fcfb0c2f39738261b6f856f4df (diff)
downloadcolord-87be4ed4411ca90b00509a42e64db3aa7d6dba5c.tar.gz
Do not automatically add EDID profiles with warnings to devices
-rw-r--r--src/cd-main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cd-main.c b/src/cd-main.c
index 9d08dca..9211c80 100644
--- a/src/cd-main.c
+++ b/src/cd-main.c
@@ -276,6 +276,8 @@ cd_main_auto_add_from_md (CdMainPrivate *priv,
{
const gchar *device_id;
const gchar *profile_id;
+ const gchar *tmp;
+ const gchar **warnings;
gboolean ret = FALSE;
GError *error = NULL;
guint64 timestamp;
@@ -297,6 +299,17 @@ cd_main_auto_add_from_md (CdMainPrivate *priv,
goto out;
}
+ /* if the auto-EDID profile has warnings then do not add this */
+ tmp = cd_profile_get_metadata_item (profile, CD_PROFILE_METADATA_DATA_SOURCE);
+ if (g_strcmp0 (tmp, CD_PROFILE_METADATA_DATA_SOURCE_EDID) == 0) {
+ warnings = cd_profile_get_warnings (profile);
+ if (g_strv_length ((gchar **) warnings) > 0) {
+ g_debug ("CdMain: NOT MD add %s to %s as profile has warnings",
+ profile_id, device_id);
+ goto out;
+ }
+ }
+
/* auto-add soft relationship */
g_debug ("CdMain: Automatically MD add %s to %s",
profile_id, device_id);