From 23a8c42d91d01fc9bb8e61c4ff7a10fe35b35ac4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jan 2009 06:01:29 +0000 Subject: [PATCH] Copy mtime by default * glocalfile.c: (g_local_file_class_init): Copy mtime by default * gfile.c: Change docs about G_FILE_COPY_ALL_METADATA to not mention mtime as an example. svn path=/branches/glib-2-18/; revision=7789 --- gio/ChangeLog | 14 ++++++++++++++ gio/gfile.c | 5 +++-- gio/glocalfile.c | 5 +++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index c138f2714..837f97c8d 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,17 @@ +2009-01-09 Matthias Clasen + + Merged from trunk: + + Bug 515777 - incorrect date&time on copy + + * glocalfile.c: + (g_local_file_class_init): + Copy mtime by default + + * gfile.c: + Change docs about G_FILE_COPY_ALL_METADATA to not mention + mtime as an example. + 2009-01-09 Matthias Clasen Merged from trunk: diff --git a/gio/gfile.c b/gio/gfile.c index 83643ea57..9a853ac4e 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -2123,9 +2123,10 @@ build_attribute_list_for_copy (GFileAttributeInfoList *attributes, * * Normally only a subset of the file attributes are copied, * those that are copies in a normal file copy operation - * (which for instance does not include e.g. mtime). However + * (which for instance does not include e.g. owner). However * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then - * all the metadata that is possible to copy is copied. + * all the metadata that is possible to copy is copied. This + * is useful when implementing move by copy + delete source. * * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise. **/ diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 3b6caa104..3fa5a35ce 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -179,11 +179,16 @@ g_local_file_class_init (GLocalFileClass *klass) g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_ATTRIBUTE_TYPE_UINT64, + G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE | G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, G_FILE_ATTRIBUTE_TYPE_UINT32, + G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE | G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED); + /* When copying, the target file is accessed. Replicating + * the source access time does not make sense in this case. + */ g_file_attribute_info_list_add (list, G_FILE_ATTRIBUTE_TIME_ACCESS, G_FILE_ATTRIBUTE_TYPE_UINT64,