diff options
author | Ondrej Holy <oholy@redhat.com> | 2014-11-13 13:38:21 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2014-11-19 08:54:41 +0100 |
commit | 7c856adf3dc29a51bd07464c4b9a00252ad8bb69 (patch) | |
tree | d3a7e73132e6c31d5e06ed66e100df6f570476b0 /daemon | |
parent | 3e73fe863c5a5201f77fe8f6e0bec81cad22288d (diff) | |
download | gvfs-7c856adf3dc29a51bd07464c4b9a00252ad8bb69.tar.gz |
dav: try copy and delete fallback if backup couldn't be created
Move operation fails immediately with G_IO_ERROR_CANT_CREATE_BACKUP if
G_FILE_COPY_BACKUP is specified. Consequently copy and delete fallback
isn't executed. Return NOT_SUPPORTED instead of CANT_CREATE_BACKUP to
proceed with the fallback if G_FILE_COPY_NO_FALLBACK_FOR_MOVE isn't
specified.
https://bugzilla.gnome.org/show_bug.cgi?id=740057
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gvfsbackenddav.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c index 3ace6e1a..b0bc22db 100644 --- a/daemon/gvfsbackenddav.c +++ b/daemon/gvfsbackenddav.c @@ -2725,10 +2725,23 @@ do_move (GVfsBackend *backend, if (flags & G_FILE_COPY_BACKUP) { - g_vfs_job_failed_literal (G_VFS_JOB(job), - G_IO_ERROR, - G_IO_ERROR_CANT_CREATE_BACKUP, - _("Backup file creation failed")); + if (flags & G_FILE_COPY_NO_FALLBACK_FOR_MOVE) + { + g_vfs_job_failed_literal (G_VFS_JOB (job), + G_IO_ERROR, + G_IO_ERROR_CANT_CREATE_BACKUP, + _("Backups not supported")); + } + else + { + /* Return G_IO_ERROR_NOT_SUPPORTED instead of G_IO_ERROR_CANT_CREATE_BACKUP + * to be proceeded with copy and delete fallback (see g_file_move). */ + g_vfs_job_failed_literal (G_VFS_JOB (job), + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + "Operation not supported"); + } + return; } |