[gnome-control-center] background: Use g_settings_delay() properly



commit 7ca2a8a3e598b49b9becb104747fa09ee10954b3
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Dec 16 19:38:31 2010 +0000

    background: Use g_settings_delay() properly
    
    g_settings_delay() doesn't work like GConf's changesets. Either
    you create a separate GSettings for non-delayed application,
    or you call g_settings_apply() any time you want changes applied.

 panels/background/cc-background-panel.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index ba3badd..feacab3 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -461,9 +461,6 @@ backgrounds_changed_cb (GtkIconView       *icon_view,
 
   gtk_tree_model_get (model, &iter, 1, &item, -1);
 
-  /* Do all changes in one 'transaction' */
-  g_settings_delay (priv->settings);
-
   if (!g_strcmp0 (item->filename, "(none)"))
     {
       g_settings_set_enum (priv->settings, WP_OPTIONS_KEY, G_DESKTOP_BACKGROUND_STYLE_NONE);
@@ -673,6 +670,8 @@ style_changed_cb (GtkComboBox       *box,
   if (priv->current_background)
     priv->current_background->options = value;
 
+  g_settings_apply (priv->settings);
+
   update_preview (priv, NULL, TRUE);
 }
 
@@ -704,6 +703,8 @@ color_changed_cb (GtkColorButton    *button,
   else
     g_settings_set_string (priv->settings, WP_SCOLOR_KEY, value);
 
+  g_settings_apply (priv->settings);
+
   g_free (value);
 
   update_preview (priv, NULL, TRUE);
@@ -736,6 +737,7 @@ cc_background_panel_init (CcBackgroundPanel *self)
     }
 
   priv->settings = g_settings_new (WP_PATH_ID);
+  g_settings_delay (priv->settings);
 
   store = (GtkListStore*) gtk_builder_get_object (priv->builder,
                                                   "sources-liststore");



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