diff options
author | Allison Ryan Lortie <desrt@desrt.ca> | 2015-11-30 14:46:12 -0500 |
---|---|---|
committer | Allison Ryan Lortie <desrt@desrt.ca> | 2015-11-30 14:59:10 -0500 |
commit | 768ed4bbe040c53ee5010038c34aec7c69dba0a5 (patch) | |
tree | ba0de89dbcc757b9f3c85cf301ae2f1e2dacf197 /client | |
parent | 014d634529f2a88ff638834dbbe827f6bb82aa16 (diff) | |
download | dconf-768ed4bbe040c53ee5010038c34aec7c69dba0a5.tar.gz |
engine, client: add list_locks() operation
Add an API to dconf-engine (and exposed via DConfClient) for getting a
list of locks that are present in a given dconf profile.
https://bugzilla.gnome.org/show_bug.cgi?id=758864
Diffstat (limited to 'client')
-rw-r--r-- | client/dconf-client.c | 26 | ||||
-rw-r--r-- | client/dconf-client.h | 4 | ||||
-rw-r--r-- | client/dconf.vapi | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/client/dconf-client.c b/client/dconf-client.c index ea2e07c..7c04982 100644 --- a/client/dconf-client.c +++ b/client/dconf-client.c @@ -324,6 +324,32 @@ dconf_client_list (DConfClient *client, } /** + * dconf_client_list_locks: + * @client: a #DConfClient + * @dir: the dir to limit results to + * @length: the length of the returned list. + * + * Lists all locks under @dir in effect for @client. + * + * If no locks are in effect, an empty list is returned. If no keys are + * writable at all then a list containing @dir is returned. + * + * The returned list will be %NULL-terminated. + * + * Returns: an array of strings, never %NULL. + */ +gchar ** +dconf_client_list_locks (DConfClient *client, + const gchar *path, + gint *length) +{ + g_return_val_if_fail (DCONF_IS_CLIENT (client), NULL); + g_return_val_if_fail (dconf_is_path (path, NULL), NULL); + + return dconf_engine_list_locks (client->engine, path, length); +} + +/** * dconf_client_is_writable: * @client: a #DConfClient * @key: the key to check for writability diff --git a/client/dconf-client.h b/client/dconf-client.h index e50792b..d15d2ce 100644 --- a/client/dconf-client.h +++ b/client/dconf-client.h @@ -46,6 +46,10 @@ gchar ** dconf_client_list (DConfCl const gchar *dir, gint *length); +gchar ** dconf_client_list_locks (DConfClient *client, + const gchar *path, + gint *length); + gboolean dconf_client_is_writable (DConfClient *client, const gchar *key); diff --git a/client/dconf.vapi b/client/dconf.vapi index 7e5cdae..1067378 100644 --- a/client/dconf.vapi +++ b/client/dconf.vapi @@ -8,6 +8,7 @@ namespace DConf { public Client (); public GLib.Variant? read (string key); public string[] list (string dir); + public string[] list_locks (string dir); public bool is_writable (string key); public void write_fast (string path, GLib.Variant? value) throws GLib.Error; public void write_sync (string path, GLib.Variant? value, out string tag = null, GLib.Cancellable? cancellable = null) throws GLib.Error; |