summaryrefslogtreecommitdiff
path: root/gsettings/dconfsettingsbackend.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-10-02 13:29:16 -0400
committerRyan Lortie <desrt@desrt.ca>2012-10-02 14:16:55 -0400
commitaef91dd114c017b6b1c47bc79a24657314d8c757 (patch)
tree47fd6e684cfa8f04e8d56ed0224409420ff7b5f4 /gsettings/dconfsettingsbackend.c
parent6b5201c34094109ffc253ed0b88d14d2d4795c36 (diff)
downloaddconf-aef91dd114c017b6b1c47bc79a24657314d8c757.tar.gz
gsettings/: support correct read of default values
The existing code had a /* XXX */ for properly dealing with the case of the user requesting the default value. We should probably implement this... https://bugzilla.gnome.org/show_bug.cgi?id=685316
Diffstat (limited to 'gsettings/dconfsettingsbackend.c')
-rw-r--r--gsettings/dconfsettingsbackend.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gsettings/dconfsettingsbackend.c b/gsettings/dconfsettingsbackend.c
index 1725d16..c8273f9 100644
--- a/gsettings/dconfsettingsbackend.c
+++ b/gsettings/dconfsettingsbackend.c
@@ -44,10 +44,23 @@ dconf_settings_backend_read (GSettingsBackend *backend,
gboolean default_value)
{
DConfSettingsBackend *dcsb = (DConfSettingsBackend *) backend;
+ GVariant *value;
- /* XXX default value */
+ if (default_value)
+ {
+ GQueue *read_through;
+
+ /* Mark the key as having been reset when trying to do the read... */
+ read_through = g_queue_new ();
+ g_queue_push_tail (read_through, dconf_changeset_new_write (key, NULL));
+ value = dconf_engine_read (dcsb->engine, read_through, key);
+ g_queue_free_full (read_through, (GDestroyNotify) dconf_changeset_unref);
+ }
+
+ else
+ value = dconf_engine_read (dcsb->engine, NULL, key);
- return dconf_engine_read (dcsb->engine, NULL, key);
+ return value;
}
static gboolean