diff options
author | Allison Ryan Lortie <desrt@desrt.ca> | 2015-12-16 10:04:13 -0500 |
---|---|---|
committer | Allison Ryan Lortie <desrt@desrt.ca> | 2015-12-16 11:31:01 -0500 |
commit | 4594876cd2b3c80a827cfe1526e0779b72777cc2 (patch) | |
tree | 6212c8e1895940feb0c4030d1fa0e7cdd12acae1 /gsettings | |
parent | a4139891fa874197e945fe409698e16a5ba35ae3 (diff) | |
download | dconf-4594876cd2b3c80a827cfe1526e0779b72777cc2.tar.gz |
engine: add DCONF_READ_DEFAULT_VALUE flag
Add a flag that allows checking the default value without constructing a
read_through queue. Make use of this new flag to simplify code in a
couple of places.
https://bugzilla.gnome.org/show_bug.cgi?id=759128
Diffstat (limited to 'gsettings')
-rw-r--r-- | gsettings/dconfsettingsbackend.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/gsettings/dconfsettingsbackend.c b/gsettings/dconfsettingsbackend.c index 0e96f5e..752e013 100644 --- a/gsettings/dconfsettingsbackend.c +++ b/gsettings/dconfsettingsbackend.c @@ -44,23 +44,10 @@ dconf_settings_backend_read (GSettingsBackend *backend, gboolean default_value) { DConfSettingsBackend *dcsb = (DConfSettingsBackend *) backend; - GVariant *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, DCONF_READ_FLAGS_NONE, read_through, key); - g_queue_free_full (read_through, (GDestroyNotify) dconf_changeset_unref); - } - - else - value = dconf_engine_read (dcsb->engine, DCONF_READ_FLAGS_NONE, NULL, key); - - return value; + return dconf_engine_read (dcsb->engine, + default_value ? DCONF_READ_DEFAULT_VALUE : 0, + NULL, key); } static GVariant * |