[dconf] client: implement write_many API
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] client: implement write_many API
- Date: Mon, 24 May 2010 21:07:05 +0000 (UTC)
commit 0ce4f19474690fc8af99b42b3604740eb213b2ae
Author: Ryan Lortie <desrt desrt ca>
Date: Mon May 24 13:59:46 2010 -0400
client: implement write_many API
client/dconf-client.c | 65 ++++++++++++++++++++++++++++++++++---------------
client/dconf-client.h | 4 +++
2 files changed, 49 insertions(+), 20 deletions(-)
---
diff --git a/client/dconf-client.c b/client/dconf-client.c
index 3a33397..2c2803f 100644
--- a/client/dconf-client.c
+++ b/client/dconf-client.c
@@ -351,28 +351,53 @@ dconf_client_is_writable (DConfClient *client,
-#if 0
+gboolean
+dconf_client_write_many (DConfClient *client,
+ const gchar *prefix,
+ const gchar * const *rels,
+ GVariant **values,
+ guint64 *sequence,
+ GCancellable *cancellable,
+ GError **error)
+{
+ DConfEngineMessage dcem;
-GVariant * dconf_client_read (DConfClient *client,
- const gchar *key,
- DConfReadType type);
+ if (!dconf_engine_write_many (client->engine, &dcem, prefix, rels, values, error))
+ return FALSE;
+ return dconf_client_call_sync (client, &dcem, sequence, cancellable, error);
+}
-gboolean dconf_client_write_many (DConfClient *client,
- const gchar *prefix,
- const gchar * const *keys,
- GVariant **values,
- GError **error);
-void dconf_client_write_many_async (DConfClient *client,
- const gchar *prefix,
- const gchar * const *keys,
- GVariant **values,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean dconf_client_write_many_finish (DConfClient *client,
- GAsyncResult *result,
- GError **error);
+void
+dconf_client_write_many_async (DConfClient *client,
+ const gchar *prefix,
+ const gchar * const *rels,
+ GVariant **values,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ DConfClientAsyncOp *op;
+ op = dconf_client_async_op_new (client, dconf_client_write_async,
+ cancellable, callback, user_data);
+ dconf_engine_write_many (client->engine, &op->dcem, prefix,
+ rels, values, &op->error);
+ dconf_client_async_op_run (op);
+}
+
+gboolean
+dconf_client_write_many_finish (DConfClient *client,
+ GAsyncResult *result,
+ guint64 *sequence,
+ GError **error)
+{
+ return dconf_client_async_op_finish (client, result,
+ dconf_client_write_many_async,
+ sequence, error);
+}
+
+#if 0
gboolean dconf_client_watch (DConfClient *client,
const gchar *name,
GError **error);
diff --git a/client/dconf-client.h b/client/dconf-client.h
index 1c65e72..3633f5a 100644
--- a/client/dconf-client.h
+++ b/client/dconf-client.h
@@ -72,15 +72,19 @@ gboolean dconf_client_write_many (DConfCl
const gchar *prefix,
const gchar * const *keys,
GVariant **values,
+ guint64 *sequence,
+ GCancellable *cancellable,
GError **error);
void dconf_client_write_many_async (DConfClient *client,
const gchar *prefix,
const gchar * const *keys,
GVariant **values,
+ GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean dconf_client_write_many_finish (DConfClient *client,
GAsyncResult *result,
+ guint64 *sequence,
GError **error);
gboolean dconf_client_watch (DConfClient *client,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]