[gnome-settings-daemon/wip/xsettings-manager] xsettings: rework delete() as set(NULL)



commit 876959ee9c343fbd1e0c41550f51259346afdd5d
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Mar 8 09:46:40 2012 -0500

    xsettings: rework delete() as set(NULL)

 plugins/xsettings/xsettings-manager.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/plugins/xsettings/xsettings-manager.c b/plugins/xsettings/xsettings-manager.c
index 43d0354..ae53919 100644
--- a/plugins/xsettings/xsettings-manager.c
+++ b/plugins/xsettings/xsettings-manager.c
@@ -193,13 +193,6 @@ xsettings_manager_destroy (XSettingsManager *manager)
   g_slice_free (XSettingsManager, manager);
 }
 
-void
-xsettings_manager_delete_setting (XSettingsManager *manager,
-                                  const char       *name)
-{
-  g_hash_table_remove (manager->settings, name);
-}
-
 static void
 xsettings_manager_set_setting (XSettingsManager *manager,
                                const gchar      *name,
@@ -217,6 +210,9 @@ xsettings_manager_set_setting (XSettingsManager *manager,
     }
 
   xsettings_setting_set (setting, value, manager->serial);
+
+  if (xsettings_setting_get (setting) == NULL)
+    g_hash_table_remove (manager->settings, name);
 }
 
 void
@@ -246,6 +242,13 @@ xsettings_manager_set_color (XSettingsManager *manager,
   xsettings_manager_set_setting (manager, name, tmp);
 }
 
+void
+xsettings_manager_delete_setting (XSettingsManager *manager,
+                                  const char       *name)
+{
+  xsettings_manager_set_setting (manager, name, NULL);
+}
+
 static gchar
 xsettings_get_typecode (GVariant *value)
 {



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