[gnome-settings-daemon] xsettings: remove global 'settings' list



commit 4d8a96debf83c469e1f869ab300a3e5cfe4d34d4
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Mar 7 19:31:53 2012 -0500

    xsettings: remove global 'settings' list
    
    This looks like an abortive attempt to merge the settings list for the
    settings managers for all screens into one.  Unfortunately, the code
    that actually calls into the settings managers to do updates still
    updated each one individually and a bunch of code in the manager itself
    was still referring to the per-instance variable (which was never
    removed).
    
    Switch back to each manager having its own copy.

 plugins/xsettings/xsettings-manager.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/plugins/xsettings/xsettings-manager.c b/plugins/xsettings/xsettings-manager.c
index c41236d..0ccf194 100644
--- a/plugins/xsettings/xsettings-manager.c
+++ b/plugins/xsettings/xsettings-manager.c
@@ -45,8 +45,6 @@ struct _XSettingsManager
   unsigned long serial;
 };
 
-static XSettingsList *settings;
-
 typedef struct 
 {
   Window window;
@@ -220,14 +218,14 @@ XSettingsResult
 xsettings_manager_delete_setting (XSettingsManager *manager,
                                   const char       *name)
 {
-  return xsettings_list_delete (&settings, name);
+  return xsettings_list_delete (&manager->settings, name);
 }
 
 static XSettingsResult
 xsettings_manager_set_setting (XSettingsManager *manager,
 			       XSettingsSetting *setting)
 {
-  XSettingsSetting *old_setting = xsettings_list_lookup (settings, setting->name);
+  XSettingsSetting *old_setting = xsettings_list_lookup (manager->settings, setting->name);
   XSettingsSetting *new_setting;
   XSettingsResult result;
 
@@ -236,7 +234,7 @@ xsettings_manager_set_setting (XSettingsManager *manager,
       if (xsettings_setting_equal (old_setting, setting))
 	return XSETTINGS_SUCCESS;
 
-      xsettings_list_delete (&settings, setting->name);
+      xsettings_list_delete (&manager->settings, setting->name);
     }
 
   new_setting = xsettings_setting_copy (setting);
@@ -245,7 +243,7 @@ xsettings_manager_set_setting (XSettingsManager *manager,
   
   new_setting->last_change_serial = manager->serial;
   
-  result = xsettings_list_insert (&settings, new_setting);
+  result = xsettings_list_insert (&manager->settings, new_setting);
   
   if (result != XSETTINGS_SUCCESS)
     xsettings_setting_free (new_setting);
@@ -386,7 +384,7 @@ xsettings_manager_notify (XSettingsManager *manager)
 
   buffer.len = 12;		/* byte-order + pad + SERIAL + N_SETTINGS */
 
-  iter = settings;
+  iter = manager->settings;
   while (iter)
     {
       buffer.len += setting_length (iter->setting);
@@ -406,7 +404,7 @@ xsettings_manager_notify (XSettingsManager *manager)
   *(CARD32 *)buffer.pos = n_settings;
   buffer.pos += 4;
 
-  iter = settings;
+  iter = manager->settings;
   while (iter)
     {
       setting_store (iter->setting, &buffer);



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