Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:GA
gvfs
gvfs-obexftp-allow-push-cancel.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gvfs-obexftp-allow-push-cancel.patch of Package gvfs
diff --git a/daemon/gvfsbackendobexftp.c b/daemon/gvfsbackendobexftp.c index e0dd84a..40416cf 100644 --- a/daemon/gvfsbackendobexftp.c +++ b/daemon/gvfsbackendobexftp.c @@ -1611,6 +1611,7 @@ push_transfer_progress_cb (DBusGProxy *proxy, gpointer user_data) { PushData *job_data = (PushData *) user_data; + GVfsBackendObexftp *op_backend = job_data->op_backend; g_message ("transfer progress"); @@ -1618,6 +1619,10 @@ push_transfer_progress_cb (DBusGProxy *proxy, job_data->progress_callback ((goffset) bytes_transferred, job_data->total_bytes, job_data->progress_callback_data); + + g_mutex_lock (&op_backend->mutex); + g_cond_signal (&op_backend->cond); + g_mutex_unlock (&op_backend->mutex); } static void @@ -1705,7 +1710,21 @@ _push_single_file_helper (GVfsBackendObexftp *op_backend, } while (op_backend->status == ASYNC_RUNNING) - g_cond_wait (&op_backend->cond, &op_backend->mutex); + { + if (g_vfs_job_is_cancelled (G_VFS_JOB (job))) + { + g_set_error_literal (&op_backend->error, G_IO_ERROR, + G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); + op_backend->status = ASYNC_ERROR; + + dbus_g_proxy_call_no_reply (op_backend->session_proxy, "Cancel", + G_TYPE_INVALID); + break; + } + + g_cond_wait (&op_backend->cond, &op_backend->mutex); + } dbus_g_proxy_disconnect_signal (op_backend->session_proxy, "TransferCompleted", G_CALLBACK (push_transfer_completed_cb), job_data);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor