summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2023-01-17 17:47:18 -0800
committerCorey Berla <corey@berla.me>2023-04-19 13:05:11 -0700
commit86f4a3f003d9883a46fe3ccff2f409267252ba72 (patch)
treeba9b5ad82ab488e8b10b037dc18bbe7cc6688246
parent9a7e8832f518c0e80f3b00157e50d94d4e8ea27f (diff)
downloadnautilus-wip/corey/partially-copied-file.tar.gz
file-operations: Don't leave partially copied file on cancelled copywip/corey/partially-copied-file
If a file copy operation is cancelled, we leave a partially copied file on the destination. This is bad because it can lead to data loss is the user believes they have successfully copied their file. Let's delete the destination file, if the operation was cancelled on a copy. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1063
-rw-r--r--src/nautilus-file-operations.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index cce3b2548..2d3c081d8 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -5838,6 +5838,10 @@ retry:
}
else if (IS_IO_ERROR (error, CANCELLED))
{
+ if (!copy_job->is_move)
+ {
+ g_file_delete (dest, NULL, NULL);
+ }
g_error_free (error);
}
/* Other error */