summaryrefslogtreecommitdiff
path: root/gsettings
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-02-04 12:37:49 +0100
committerRyan Lortie <desrt@desrt.ca>2013-02-11 13:36:09 -0500
commit4c516a76f55d75ecfa1b985adb1905cac945f3fe (patch)
tree19d0d22ce73ee8d5c19f2c39135b537ab17f2266 /gsettings
parent9d0b53f86371a459615e9872a5b835b917a568ae (diff)
downloaddconf-4c516a76f55d75ecfa1b985adb1905cac945f3fe.tar.gz
engine, gsettings: prevent empty changesets
We should not send empty changesets to the service so just ignore them when we get them. This now means that an empty 'dconf load' will not send any D-Bus messages (and will not cause D-Bus activation).
Diffstat (limited to 'gsettings')
-rw-r--r--gsettings/dconfsettingsbackend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gsettings/dconfsettingsbackend.c b/gsettings/dconfsettingsbackend.c
index c8273f9..53f701e 100644
--- a/gsettings/dconfsettingsbackend.c
+++ b/gsettings/dconfsettingsbackend.c
@@ -101,9 +101,11 @@ dconf_settings_backend_write_tree (GSettingsBackend *backend,
DConfChangeset *change;
gboolean success;
- change= dconf_changeset_new ();
- g_tree_foreach (tree, dconf_settings_backend_add_to_changeset, change);
+ if (g_tree_nnodes (tree) == 0)
+ return TRUE;
+ change = dconf_changeset_new ();
+ g_tree_foreach (tree, dconf_settings_backend_add_to_changeset, change);
success = dconf_engine_change_fast (dcsb->engine, change, origin_tag, NULL);
dconf_changeset_unref (change);