summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-08-10 15:02:12 +0200
committerMartin Wimpress <[email protected]>2019-08-15 09:46:53 +0100
commit0c420a0360f355fa89d81cce9b7696eba99bcc5c (patch)
treee0e95135567e9ab521deeee4bc75e7e0ccba1b71 /libcaja-private
parent080d270b9f2df76fce8e66544f8bcb6eaaa46888 (diff)
downloadcaja-0c420a0360f355fa89d81cce9b7696eba99bcc5c.tar.bz2
caja-0c420a0360f355fa89d81cce9b7696eba99bcc5c.tar.xz
Copy file and keep timestamps of original file including remotes
The timestamps are reset to the current time, even if the source & target folders support these GFileInfo attributes. Closes #1226
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-file-operations.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c
index d4fa7826..ed130d6d 100644
--- a/libcaja-private/caja-file-operations.c
+++ b/libcaja-private/caja-file-operations.c
@@ -3718,7 +3718,7 @@ copy_move_directory (CopyMoveJob *copy_job,
if (create_dest) {
flags = (readonly_source_fs) ? G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_TARGET_DEFAULT_PERMS
- : G_FILE_COPY_NOFOLLOW_SYMLINKS;
+ : G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_ALL_METADATA;
/* Ignore errors here. Failure to copy metadata is not a hard error */
g_file_copy_attributes (src, *dest,
flags,
@@ -4274,6 +4274,13 @@ copy_move_file (CopyMoveJob *copy_job,
}
if (res) {
+ if (!copy_job->is_move) {
+ /* Ignore errors here. Failure to copy metadata is not a hard error */
+ g_file_copy_attributes (src, dest,
+ flags | G_FILE_COPY_ALL_METADATA,
+ job->cancellable, NULL);
+ }
+
transfer_info->num_files ++;
report_copy_progress (copy_job, source_info, transfer_info);