[gnome-color-manager] trivial: when generating the auto-edid profile, use the DMI data if the EDID data is not provided



commit 9df5389f01ededee85c032fa3418bd67c882876d
Author: Richard Hughes <richard hughsie com>
Date:   Mon Apr 18 10:11:20 2011 +0100

    trivial: when generating the auto-edid profile, use the DMI data if the EDID data is not provided

 src/gcm-session.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gcm-session.c b/src/gcm-session.c
index 402f28d..f1883de 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -370,7 +370,8 @@ out:
  * gcm_apply_create_icc_profile_for_edid:
  **/
 static gboolean
-gcm_apply_create_icc_profile_for_edid (GcmEdid *edid,
+gcm_apply_create_icc_profile_for_edid (GcmSessionPrivate *priv,
+				       GcmEdid *edid,
 				       const gchar *filename,
 				       GError **error)
 {
@@ -393,19 +394,23 @@ gcm_apply_create_icc_profile_for_edid (GcmEdid *edid,
 	/* get manufacturer */
 	data = gcm_edid_get_vendor_name (edid);
 	if (data == NULL)
+		data = gcm_dmi_get_vendor (priv->dmi);
+	if (data == NULL)
 		data = "Unknown vendor";
 	gcm_profile_set_manufacturer (profile, data);
 
 	/* get model */
 	data = gcm_edid_get_monitor_name (edid);
 	if (data == NULL)
+		data = gcm_dmi_get_name (priv->dmi);
+	if (data == NULL)
 		data = "Unknown monitor";
 	gcm_profile_set_model (profile, data);
 
 	/* TRANSLATORS: this is prepended to the device title to let the use know it was generated by us automatically */
 	title = g_strdup_printf ("%s, %s",
 				 _("Automatic"),
-				 gcm_edid_get_monitor_name (edid));
+				 data);
 	gcm_profile_set_description (profile, title);
 
 	/* generate a profile from the chroma data */
@@ -608,7 +613,8 @@ gcm_session_device_assign (GcmSessionPrivate *priv, CdDevice *device)
 	} else {
 		g_debug ("auto-profile edid does not exist, creating as %s",
 			 autogen_path);
-		ret = gcm_apply_create_icc_profile_for_edid (edid,
+		ret = gcm_apply_create_icc_profile_for_edid (priv,
+							     edid,
 							     autogen_path,
 							     &error);
 		if (!ret) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]