[dconf] 'list' updates



commit 26dc76a0f59cc5449c024429edf50f4263261ff1
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon May 24 23:18:36 2010 -0400

    'list' updates
    
      - move to new GSettingsBackend API
      - add 'length' parameter, update callers

 bin/dconf.c                      |    2 +-
 client/dconf-client.c            |    5 +++--
 client/dconf-client.h            |    3 ++-
 engine/dconf-engine.c            |    6 +++++-
 engine/dconf-engine.h            |    3 ++-
 gsettings/dconfsettingsbackend.c |   12 ++++++++----
 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]