[gnome-control-center] color: Don't emit a critical warning if the panel starts with a colorimeter already plugged in



commit 5912f0027375a4d9f7f969adf88a29c2a1892cc1
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jun 2 16:39:09 2011 +0100

    color: Don't emit a critical warning if the panel starts with a colorimeter already plugged in

 panels/color/cc-color-panel.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index 9c0e6e5..9ca6e75 100644
--- a/panels/color/cc-color-panel.c
+++ b/panels/color/cc-color-panel.c
@@ -1065,6 +1065,7 @@ gcm_prefs_sensor_coldplug (CcColorPanel *prefs)
 {
   GPtrArray *sensors;
   GError *error = NULL;
+  gboolean ret;
   CcColorPanelPrivate *priv = prefs->priv;
 
   /* unref old */
@@ -1087,6 +1088,15 @@ gcm_prefs_sensor_coldplug (CcColorPanel *prefs)
 
   /* save a copy of the sensor */
   priv->sensor = g_object_ref (g_ptr_array_index (sensors, 0));
+
+  /* connect to the sensor */
+  ret = cd_sensor_connect_sync (priv->sensor, NULL, &error);
+  if (!ret)
+    {
+      g_warning ("%s", error->message);
+      g_error_free (error);
+      goto out;
+    }
 out:
   if (sensors != NULL)
     g_ptr_array_unref (sensors);



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