diff options
author | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 11:19:39 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 11:19:39 +0000 |
commit | cb546a903e612d8b3e00137ea7a82ef10a6e808c (patch) | |
tree | e71ee6bbe708176239cdacd42098dc8be6892a52 /client | |
parent | 4e560bfe853ddfce63d43bc2a2eaa5040a3ca774 (diff) | |
download | gvfs-cb546a903e612d8b3e00137ea7a82ef10a6e808c.tar.gz |
Clean up _g_vfs_daemon_call_async
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1170167354 +0100
svn path=/trunk/; revision=285
Diffstat (limited to 'client')
-rw-r--r-- | client/gfiledaemon.c | 41 | ||||
-rw-r--r-- | client/gvfsdaemondbus.c | 10 | ||||
-rw-r--r-- | client/gvfsdaemondbus.h | 7 |
3 files changed, 30 insertions, 28 deletions
diff --git a/client/gfiledaemon.c b/client/gfiledaemon.c index 6293ae84..9160ee81 100644 --- a/client/gfiledaemon.c +++ b/client/gfiledaemon.c @@ -207,6 +207,15 @@ do_sync_path_call (GFile *file, return reply; } +typedef void (*AsyncPathCallCallback) (DBusMessage *reply, + DBusConnection *connection, + GError *io_error, + GCancellable *cancellable, + gpointer op_callback, + gpointer op_callback_data, + gpointer callback_data); + + typedef struct { GFile *file; char *op; @@ -215,7 +224,7 @@ typedef struct { GError *io_error; gpointer op_callback; gpointer op_callback_data; - GVfsAsyncDBusCallback callback; + AsyncPathCallCallback callback; gpointer callback_data; } AsyncPathCall; @@ -238,18 +247,30 @@ do_async_path_call_error_idle (gpointer _data) { AsyncPathCall *data = _data; - data->callback (NULL, NULL, - data->io_error, - data->cancellable, - data->op_callback, - data->op_callback_data, + data->callback (NULL, NULL, data->io_error, data->cancellable, + data->op_callback, data->op_callback_data, data->callback_data); async_path_call_free (data); return FALSE; } + +static void +async_path_call_done (DBusMessage *reply, + DBusConnection *connection, + GError *io_error, + gpointer _data) +{ + AsyncPathCall *data = _data; + + data->callback (reply, connection, io_error, data->cancellable, + data->op_callback, data->op_callback_data, + data->callback_data); + async_path_call_free (data); +} + static void do_async_path_call_callback (GMountInfo *mount_info, gpointer _data, @@ -288,15 +309,11 @@ do_async_path_call_callback (GMountInfo *mount_info, _g_dbus_message_iter_copy (&arg_dest, &arg_source); } - /* TODO: ref GFile during async call? */ - _g_vfs_daemon_call_async (message, - data->op_callback, data->op_callback_data, - data->callback, data->callback_data, + async_path_call_done, data, data->cancellable); dbus_message_unref (message); - async_path_call_free (data); } static void @@ -305,7 +322,7 @@ do_async_path_call (GFile *file, GCancellable *cancellable, gpointer op_callback, gpointer op_callback_data, - GVfsAsyncDBusCallback callback, + AsyncPathCallCallback callback, gpointer callback_data, int first_arg_type, ...) diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c index a3028ae7..a1612909 100644 --- a/client/gvfsdaemondbus.c +++ b/client/gvfsdaemondbus.c @@ -345,9 +345,6 @@ typedef struct { GVfsAsyncDBusCallback callback; gpointer callback_data; - gpointer op_callback; - gpointer op_callback_data; - GError *io_error; gulong cancelled_tag; } AsyncDBusCall; @@ -358,9 +355,6 @@ async_call_finish (AsyncDBusCall *async_call, { async_call->callback (reply, async_call->connection, async_call->io_error, - async_call->cancellable, - async_call->op_callback, - async_call->op_callback_data, async_call->callback_data); if (async_call->connection) @@ -627,8 +621,6 @@ open_connection_async (AsyncDBusCall *async_call) void _g_vfs_daemon_call_async (DBusMessage *message, - gpointer op_callback, - gpointer op_callback_data, GVfsAsyncDBusCallback callback, gpointer callback_data, GCancellable *cancellable) @@ -644,8 +636,6 @@ _g_vfs_daemon_call_async (DBusMessage *message, async_call->cancellable = g_object_ref (cancellable); async_call->callback = callback; async_call->callback_data = callback_data; - async_call->op_callback = op_callback; - async_call->op_callback_data = op_callback_data; async_call->connection = get_connection_for_async (async_call->dbus_id); if (async_call->connection == NULL) diff --git a/client/gvfsdaemondbus.h b/client/gvfsdaemondbus.h index f79d4265..711e8042 100644 --- a/client/gvfsdaemondbus.h +++ b/client/gvfsdaemondbus.h @@ -9,11 +9,8 @@ G_BEGIN_DECLS typedef void (*GVfsAsyncDBusCallback) (DBusMessage *reply, - DBusConnection *conntection, + DBusConnection *connection, GError *io_error, - GCancellable *cancellable, - gpointer op_callback, - gpointer op_callback_data, gpointer callback_data); typedef void (*GetFdAsyncCallback) (int fd, gpointer callback_data); @@ -34,8 +31,6 @@ void _g_dbus_connection_get_fd_async (DBusConnection GetFdAsyncCallback callback, gpointer callback_data); void _g_vfs_daemon_call_async (DBusMessage *message, - gpointer op_callback, - gpointer op_callback_data, GVfsAsyncDBusCallback callback, gpointer callback_data, GCancellable *cancellable); |