From 42682604352849723ac060df46ccf55a30c38700 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 2 Mar 2012 14:14:54 +0000 Subject: [PATCH 1/2] TpProxy codegen: always invoke the method via invoke_callback --- tools/glib-client-gen.py | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py index a5bac2c..d2b9c12 100644 --- a/tools/glib-client-gen.py +++ b/tools/glib-client-gen.py @@ -796,33 +796,26 @@ class Generator(object): self.b('') self.b(' iface = tp_proxy_borrow_interface_by_id (') self.b(' (TpProxy *) proxy,') - self.b(' interface, &error);') + self.b(' interface, (callback == NULL ? NULL : &error));') self.b('') - self.b(' if (iface == NULL)') + self.b(' if (iface == NULL && callback != NULL)') self.b(' {') - self.b(' if (callback != NULL)') - self.b(' callback (proxy,') - - for arg in out_args: - name, info, tp_type, elt = arg - ctype, gtype, marshaller, pointer = info - - if pointer: - self.b(' NULL,') - else: - self.b(' 0,') - - self.b(' error, user_data, weak_object);') + self.b(' /* consumes error */') + self.b(' %s ((TpProxy *) proxy,' % invoke_callback) + self.b(' error, NULL, (GCallback) callback, user_data,') + self.b(' weak_object);') self.b('') self.b(' if (destroy != NULL)') self.b(' destroy (user_data);') self.b('') - self.b(' g_error_free (error);') self.b(' return NULL;') self.b(' }') self.b('') self.b(' if (callback == NULL)') self.b(' {') + self.b(' if (iface == NULL)') + self.b(' return NULL;') + self.b('') self.b(' dbus_g_proxy_call_no_reply (iface, "%s",' % member) for arg in in_args: -- 1.7.9.1