summaryrefslogtreecommitdiff
path: root/daemon/gvfsjobpull.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-06-10 11:36:22 +0200
committerBenjamin Otte <otte@gnome.org>2009-06-10 17:06:41 +0200
commitdf5339b873f1f1e9dd1c1d9fe113a16b52808213 (patch)
treeaa608caef85ce21f3e67e59fa8b895706c982088 /daemon/gvfsjobpull.c
parent060d792d9a47009e33ee01aac0706893deb80e9b (diff)
signal the need for updates (changes wire protocol and internal API)
Send a boolean send_progress to the daemon in the case of push/pull jobs that indicates if progress updates should be sent to the client. Oftentimes the daemons can avoid quite a bit of work (like querying file sizes or setting up and operating machinery required to send progress updates) when it's not required. Patch also includes fixes to daemons to ensure they don't call a NULL progress_callback (previously, NULL was not a possible value).
Diffstat (limited to 'daemon/gvfsjobpull.c')
-rw-r--r--daemon/gvfsjobpull.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/daemon/gvfsjobpull.c b/daemon/gvfsjobpull.c
index 58e67afb..b69d1a7e 100644
--- a/daemon/gvfsjobpull.c
+++ b/daemon/gvfsjobpull.c
@@ -87,7 +87,7 @@ g_vfs_job_pull_new (DBusConnection *connection,
int path1_len, path2_len;
const char *path1_data, *path2_data, *callback_obj_path;
dbus_uint32_t flags;
- dbus_bool_t remove_source;
+ dbus_bool_t remove_source, send_progress;
dbus_error_init (&derror);
if (!dbus_message_get_args (message, &derror,
@@ -95,6 +95,7 @@ g_vfs_job_pull_new (DBusConnection *connection,
&path1_data, &path1_len,
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
&path2_data, &path2_len,
+ DBUS_TYPE_BOOLEAN, &send_progress,
DBUS_TYPE_UINT32, &flags,
DBUS_TYPE_OBJECT_PATH, &callback_obj_path,
DBUS_TYPE_BOOLEAN, &remove_source,
@@ -118,6 +119,7 @@ g_vfs_job_pull_new (DBusConnection *connection,
job->local_path = g_strndup (path2_data, path2_len);
job->backend = backend;
job->flags = flags;
+ job->send_progress = send_progress;
job->remove_source = remove_source;
g_debug ("Remove Source: %s\n", remove_source ? "true" : "false");
if (strcmp (callback_obj_path, "/org/gtk/vfs/void") != 0)
@@ -180,8 +182,8 @@ run (GVfsJob *job)
op_job->local_path,
op_job->flags,
op_job->remove_source,
- progress_callback,
- job);
+ op_job->send_progress ? progress_callback : NULL,
+ op_job->send_progress ? job : NULL);
}
static gboolean
@@ -199,8 +201,8 @@ try (GVfsJob *job)
op_job->local_path,
op_job->flags,
op_job->remove_source,
- progress_callback,
- job);
+ op_job->send_progress ? progress_callback : NULL,
+ op_job->send_progress ? job : NULL);
}
/* Might be called on an i/o thread */