[gnome-control-center] color: When setting the default profile for a display, use the correct device



commit 18365c1c5602633abeba8231898fbe5a70ceb3df
Author: Richard Hughes <richard hughsie com>
Date:   Fri Aug 26 12:14:31 2011 +0100

    color: When setting the default profile for a display, use the correct device
    
    Using current_device breaks when you have more than one monitor that is color
    managed, and you select device #1 and then click on a different profile for
    device #2.
    
    In this case we want to change the default profile on device #2, not device #1.

 panels/color/cc-color-panel.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index 62b175c..30dfbfe 100644
--- a/panels/color/cc-color-panel.c
+++ b/panels/color/cc-color-panel.c
@@ -496,6 +496,7 @@ gcm_prefs_profile_make_default_internal (CcColorPanel *prefs,
                                          GtkTreeModel *model,
                                          GtkTreeIter *iter_selected)
 {
+  CdDevice *device;
   CdProfile *profile;
   GError *error = NULL;
   gboolean ret = FALSE;
@@ -503,13 +504,14 @@ gcm_prefs_profile_make_default_internal (CcColorPanel *prefs,
 
   /* get currentlt selected item */
   gtk_tree_model_get (model, iter_selected,
+                      GCM_PREFS_COLUMN_DEVICE, &device,
                       GCM_PREFS_COLUMN_PROFILE, &profile,
                       -1);
-  if (profile == NULL)
+  if (profile == NULL || device == NULL)
     goto out;
 
   /* just set it default */
-  ret = cd_device_make_profile_default_sync (priv->current_device,
+  ret = cd_device_make_profile_default_sync (device,
                                              profile,
                                              priv->cancellable,
                                              &error);
@@ -522,6 +524,8 @@ gcm_prefs_profile_make_default_internal (CcColorPanel *prefs,
 out:
   if (profile != NULL)
     g_object_unref (profile);
+  if (device != NULL)
+    g_object_unref (device);
 }
 
 static void



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