[gvfs/mtp-backend: 36/64] MTP: "Fix" pulling of directories.
- From: Philip Langdale <philipl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/mtp-backend: 36/64] MTP: "Fix" pulling of directories.
- Date: Sat, 12 Jan 2013 04:37:10 +0000 (UTC)
commit 191688fd5528b5c8a3f2b23af7a2ab1c23f93074
Author: Philip Langdale <philipl overt org>
Date: Wed Oct 10 13:25:18 2012 -0700
MTP: "Fix" pulling of directories.
No, this doesn't make recursive pull magically work, but it allows
a pull on a directory to make that directory, or silently succeed
if the directory exists already.
This does have the beneficial effect that file-roller can now
compress a directory from an mtp mount - if you ignore the fact
that it doesn't use display names.
daemon/gvfsbackendmtp.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index 6f4158d..b14b19b 100644
--- a/daemon/gvfsbackendmtp.c
+++ b/daemon/gvfsbackendmtp.c
@@ -948,8 +948,12 @@ do_pull(GVfsBackend *backend,
error = NULL;
if (g_file_make_directory (file, G_VFS_JOB (job)->cancellable, &error)) {
g_vfs_job_succeeded (G_VFS_JOB (job));
+ } else if (error->code == G_IO_ERROR_EXISTS) {
+ g_vfs_job_succeeded (G_VFS_JOB (job));
+ g_error_free (error);
} else {
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ DEBUG ("(II) pull dir failed: %s", error->message);
g_error_free (error);
}
g_object_unref (file);
@@ -967,10 +971,9 @@ do_pull(GVfsBackend *backend,
fail_job(G_VFS_JOB(job), device);
goto exit;
}
+ g_vfs_job_succeeded (G_VFS_JOB (job));
}
- g_vfs_job_succeeded (G_VFS_JOB (job));
-
exit:
if (info != NULL) {
g_object_unref(info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]