[patch] remove DBusGPendingCall

Colin Walters walters at verbum.org
Fri Jul 8 05:19:18 EST 2005

On Thu, 2005-07-07 at 19:58 +0100, Ross Burton wrote:
> On Thu, 2005-07-07 at 13:08 -0400, Colin Walters wrote:
> > Ok.  One thing to consider is - shouldn't you be passing the 
> > DBusGProxy * into the async callbacks?
> Not sure I follow.  This is the generated code:
> typedef void (*BookFactory_get_book_reply) (char *OUT_path, GError *error, gpointer userdata);
> static void
> BookFactory_get_book_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
> {
>   DBusGAsyncData *data = user_data;
>   GError *error = NULL;
>   char* OUT_path;
>   dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_path, G_TYPE_INVALID);
>   (*(BookFactory_get_book_reply)data->cb) (OUT_path, error, data->userdata);

What I mean is, don't you want to pass the DBusGProxy * to the callback
here?  (And change the typedef above to hold it)?  People might have
additional data keyed off the proxy instead of in user data for the call
or something.  For example you might just pass your generic app data to
an async call, and when it returns do a 
g_hash_table_lookup (appdata->outgoing_get_book_calls, proxy) to get
additional data instead of creating a new structure with the main app
data and the call-specific data and passing that as your user data.

Also I just noticed - the wrappers don't seem to provide a means of
cancelling the call?  Shouldn't you return the DBusGProxyCall instead of
always returning TRUE?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050707/10560787/attachment-0001.pgp

More information about the dbus mailing list