summaryrefslogtreecommitdiff
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:15:54 -0400
commit3f6a05f49539b2c751e14466078822b0c72daee4 (patch)
treef64e817331aa5e23923c0a72e4a18be96122cde8
parentb5f59c954ca7644adc98111bf82e80d6271372a5 (diff)
downloaddconf-3f6a05f49539b2c751e14466078822b0c72daee4.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
-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