diff options
author | Allison Ryan Lortie <desrt@desrt.ca> | 2015-12-16 10:16:15 -0500 |
---|---|---|
committer | Allison Ryan Lortie <desrt@desrt.ca> | 2015-12-16 11:31:06 -0500 |
commit | 4a80e6ce540d4ce652ccf963cdb4fb44cb514a5b (patch) | |
tree | ce40de8eb00a04152b69676666fef35105f7e74d /client/dconf-client.c | |
parent | 177740fe165f0c4f6215412f509c96b3a6fef336 (diff) | |
download | dconf-4a80e6ce540d4ce652ccf963cdb4fb44cb514a5b.tar.gz |
client: replace _read_default() with _read_full()
This API has never appeared in a released version of dconf (even
unstable). Replace it with a more generally-useful form.
Update the test cases, dconf commandline tool and vapi accordingly.
https://bugzilla.gnome.org/show_bug.cgi?id=759128
Diffstat (limited to 'client/dconf-client.c')
-rw-r--r-- | client/dconf-client.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/client/dconf-client.c b/client/dconf-client.c index 0742748..f71a263 100644 --- a/client/dconf-client.c +++ b/client/dconf-client.c @@ -246,29 +246,52 @@ dconf_client_read (DConfClient *client, } /** - * dconf_client_read_default: + * dconf_client_read_full: * @client: a #DConfClient * @key: the key to read the default value of + * @flags: #DConfReadFlags + * @read_through: a #GQueue of #DConfChangeset * - * Reads the current default value of @key. + * Reads the current value of @key. + * + * If @flags contains %DCONF_READ_USER_VALUE then only the user value + * will be read. Locks are ignored, which means that it is possible to + * use this API to read "invisible" user values which are hidden by + * system locks. + * + * If @flags contains %DCONF_READ_DEFAULT_VALUE then only non-user + * values will be read. The result will be exactly equivalent to the + * value that would be read if the current value of the key were to be + * reset. * - * The default value of the key is the value that the key would have if - * were to be reset. This is usually %NULL, but it may be something - * else in the case that the system administrator has defined a default - * value for a key. + * Flags may not contain both %DCONF_READ_USER_VALUE and + * %DCONF_READ_DEFAULT_VALUE. + * + * If @read_through is non-%NULL, %DCONF_READ_DEFAULT_VALUE is not + * given then @read_through is checked for the key in question, subject + * to the restriction that the key in question is writable. This + * effectively answers the question of "what would happen if these + * changes were committed". * * If there are outstanding "fast" changes in progress they may affect * the result of this call. * + * If @flags is %DCONF_READ_FLAGS_NONE and @read_through is %NULL then + * this call is exactly equivalent to dconf_client_read(). + * * Returns: a #GVariant, or %NULL + * + * Since: 0.26 */ GVariant * -dconf_client_read_default (DConfClient *client, - const gchar *key) +dconf_client_read_full (DConfClient *client, + const gchar *key, + DConfReadFlags flags, + const GQueue *read_through) { g_return_val_if_fail (DCONF_IS_CLIENT (client), NULL); - return dconf_engine_read (client->engine, DCONF_READ_DEFAULT_VALUE, NULL, key); + return dconf_engine_read (client->engine, flags, read_through, key); } /** |