summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-05-24 23:18:36 -0400
committerRyan Lortie <desrt@desrt.ca>2010-05-24 23:18:36 -0400
commit26dc76a0f59cc5449c024429edf50f4263261ff1 (patch)
tree01c94346c7d3f5d3e9fc67909a193f8c4ea240d3
parent873d7386d1ed64f8d542366a5d560f0ec7ba7cab (diff)
downloaddconf-26dc76a0f59cc5449c024429edf50f4263261ff1.tar.gz
'list' updates
- move to new GSettingsBackend API - add 'length' parameter, update callers
-rw-r--r--bin/dconf.c2
-rw-r--r--client/dconf-client.c5
-rw-r--r--client/dconf-client.h3
-rw-r--r--engine/dconf-engine.c6
-rw-r--r--engine/dconf-engine.h3
-rw-r--r--gsettings/dconfsettingsbackend.c12
6 files changed, 21 insertions, 10 deletions
diff --git a/bin/dconf.c b/bin/dconf.c
index 5252f4a..e6eea16 100644
--- a/bin/dconf.c
+++ b/bin/dconf.c
@@ -170,7 +170,7 @@ do_sync_command (DConfClient *client,
if (!ensure ("dir", dir, dconf_is_dir, error))
return FALSE;
- list = dconf_client_list (client, dir, NULL);
+ list = dconf_client_list (client, dir, NULL, NULL);
while (*list)
g_print ("%s\n", *list++);
diff --git a/client/dconf-client.c b/client/dconf-client.c
index 191a8e5..daf449f 100644
--- a/client/dconf-client.c
+++ b/client/dconf-client.c
@@ -295,9 +295,10 @@ dconf_client_write_finish (DConfClient *client,
gchar **
dconf_client_list (DConfClient *client,
const gchar *prefix,
- DConfResetList *resets)
+ DConfResetList *resets,
+ gsize *length)
{
- return dconf_engine_list (client->engine, prefix, resets);
+ return dconf_engine_list (client->engine, prefix, resets, length);
}
gboolean
diff --git a/client/dconf-client.h b/client/dconf-client.h
index 3633f5a..77ec0cb 100644
--- a/client/dconf-client.h
+++ b/client/dconf-client.h
@@ -30,7 +30,8 @@ GVariant * dconf_client_read (DConfCl
gchar ** dconf_client_list (DConfClient *client,
const gchar *prefix,
- DConfResetList *resets);
+ DConfResetList *resets,
+ gsize *length);
gboolean dconf_client_is_writable (DConfClient *client,
const gchar *prefix,
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 7a01470..382dc07 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -186,7 +186,8 @@ dconf_engine_set_locked (DConfEngine *engine,
gchar **
dconf_engine_list (DConfEngine *engine,
const gchar *dir,
- DConfResetList *resets)
+ DConfResetList *resets,
+ gsize *length)
{
GvdbTable *table;
gchar *filename;
@@ -203,6 +204,9 @@ dconf_engine_list (DConfEngine *engine,
gvdb_table_unref (table);
+ if (length)
+ *length = g_strv_length (list);
+
return list;
}
diff --git a/engine/dconf-engine.h b/engine/dconf-engine.h
index 249ca96..2cf72c8 100644
--- a/engine/dconf-engine.h
+++ b/engine/dconf-engine.h
@@ -32,7 +32,8 @@ GVariant * dconf_engine_read (DConfEn
DConfReadType type);
gchar ** dconf_engine_list (DConfEngine *engine,
const gchar *path,
- DConfResetList *resets);
+ DConfResetList *resets,
+ gsize *length);
void dconf_engine_get_service_info (DConfEngine *engine,
const gchar **bus_type,
diff --git a/gsettings/dconfsettingsbackend.c b/gsettings/dconfsettingsbackend.c
index 913f2b1..878409d 100644
--- a/gsettings/dconfsettingsbackend.c
+++ b/gsettings/dconfsettingsbackend.c
@@ -328,13 +328,17 @@ dconf_settings_backend_read (GSettingsBackend *backend,
}
static gchar **
-dconf_settings_backend_list (GSettingsBackend *backend,
- const gchar *dir,
- gsize *length)
+dconf_settings_backend_list (GSettingsBackend *backend,
+ const gchar *dir,
+ gchar **resets,
+ gsize n_resets,
+ gsize *length)
{
DConfSettingsBackend *dcsb = (DConfSettingsBackend *) backend;
- return dconf_engine_list (dcsb->engine, dir, NULL);
+ g_assert (n_resets == 0);
+
+ return dconf_engine_list (dcsb->engine, dir, NULL, length);
}
static void