[dconf] Adapt to GDBus API changes
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] Adapt to GDBus API changes
- Date: Mon, 24 May 2010 21:07:10 +0000 (UTC)
commit 3bca0fa065fc55fe5fa0760d9cd75674064a22d3
Author: Ryan Lortie <desrt desrt ca>
Date: Mon May 24 17:06:42 2010 -0400
Adapt to GDBus API changes
client/dconf-client.c | 40 +++++++++-------------------------------
engine/dconf-engine.c | 2 +-
engine/dconf-engine.h | 2 +-
3 files changed, 11 insertions(+), 33 deletions(-)
---
diff --git a/client/dconf-client.c b/client/dconf-client.c
index 2c2803f..191a8e5 100644
--- a/client/dconf-client.c
+++ b/client/dconf-client.c
@@ -17,24 +17,6 @@ struct _DConfClient
G_DEFINE_TYPE (DConfClient, dconf_client, G_TYPE_OBJECT)
-static gboolean
-dconf_client_check_reply_type (DConfEngineMessage *dcem,
- GVariant *reply,
- GError **error)
-{
- const gchar *type_string = g_variant_get_type_string (reply);
-
- if (strcmp (type_string, dcem->reply_type) == 0)
- return TRUE;
-
- g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
- "method '%s.%s' should return '%s', but we got '%s'\n",
- dcem->interface, dcem->method, dcem->reply_type, type_string);
- g_variant_unref (reply);
-
- return FALSE;
-}
-
static GBusType
dconf_client_bus_type (DConfEngineMessage *dcem)
{
@@ -120,12 +102,10 @@ dconf_client_async_op_call_done (GObject *object,
DConfClientAsyncOp *op = user_data;
GVariant *reply;
- reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (object),
- result, &op->error);
-
- if (reply && dconf_client_check_reply_type (&op->dcem, reply, &op->error))
- g_simple_async_result_set_op_res_gpointer (op->simple, reply,
- (GDestroyNotify) g_variant_unref);
+ if ((reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (object),
+ result, &op->error)))
+ g_simple_async_result_set_op_res_gpointer (op->simple, reply,
+ (GDestroyNotify) g_variant_unref);
dconf_client_async_op_complete (op, FALSE);
}
@@ -139,10 +119,10 @@ dconf_client_async_op_get_bus_done (GObject *no_object,
GDBusConnection *connection;
if ((connection = g_bus_get_finish (result, &op->error)) && op->dcem.body)
- g_dbus_connection_call (connection,
- op->dcem.destination, op->dcem.object_path,
- op->dcem.interface, op->dcem.method,
- op->dcem.body, 0, -1, op->cancellable,
+ g_dbus_connection_call (connection, op->dcem.destination,
+ op->dcem.object_path, op->dcem.interface,
+ op->dcem.method, op->dcem.body,
+ op->dcem.reply_type, 0, -1, op->cancellable,
dconf_client_async_op_call_done, op);
else
@@ -252,15 +232,13 @@ dconf_client_call_sync (DConfClient *client,
reply = g_dbus_connection_call_sync (connection, dcem->destination,
dcem->object_path, dcem->interface,
dcem->method, dcem->body,
+ dcem->reply_type,
G_DBUS_CALL_FLAGS_NONE, -1,
cancellable, error);
if (reply == NULL)
return FALSE;
- if (!dconf_client_check_reply_type (dcem, reply, error))
- return FALSE;
-
if (sequence)
g_variant_get (reply, "(t)", sequence);
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 54bf2ed..7a01470 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -129,7 +129,7 @@ dconf_engine_dcem (DConfEngine *engine,
dcem->destination = "ca.desrt.dconf";
dcem->object_path = "/";
dcem->interface = "ca.desrt.dconf.Writer";
- dcem->reply_type = "(t)";
+ dcem->reply_type = G_VARIANT_TYPE ("(t)");
dcem->method = method;
va_start (ap, format_string);
diff --git a/engine/dconf-engine.h b/engine/dconf-engine.h
index cc44b27..249ca96 100644
--- a/engine/dconf-engine.h
+++ b/engine/dconf-engine.h
@@ -14,7 +14,7 @@ typedef struct
const gchar *object_path;
const gchar *interface;
const gchar *method;
- const gchar *reply_type;
+ const GVariantType *reply_type;
GVariant *body;
} DConfEngineMessage;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]