changeset 560:1ce11a3d9557

2004-9-22 Brian Masney <masneyb@gftp.org> * lib/options.h src/uicommon/gftpui.c - added option to preserve the file time. In the past, it would save the file time if saving the file permissions was enabled.
author masneyb
date Thu, 23 Sep 2004 01:04:32 +0000
parents b497d05cb591
children b4667e14fd0c
files ChangeLog lib/options.h src/uicommon/gftpui.c
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 22 23:38:53 2004 +0000
+++ b/ChangeLog	Thu Sep 23 01:04:32 2004 +0000
@@ -1,4 +1,8 @@
 2004-9-22 Brian Masney <masneyb@gftp.org>
+	* lib/options.h src/uicommon/gftpui.c - added option to preserve the
+	file time. In the past, it would save the file time if saving the file
+	permissions was enabled.
+
 	* src/gtk/transfer.c (check_done_process) - if the process returned an
 	error code, then remove the file and don't prompt the user to upload the
 	file if it was changed
@@ -2842,7 +2846,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.324 2004/09/22 23:38:53 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.325 2004/09/23 01:04:32 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/options.h	Wed Sep 22 23:38:53 2004 +0000
+++ b/lib/options.h	Thu Sep 23 01:04:32 2004 +0000
@@ -76,6 +76,11 @@
    GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Preserve file permissions of transfered files"), GFTP_PORT_ALL,
    NULL},
+  {"preserve_time", N_("Preserve file time"), 
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
+   N_("Preserve file times of transfered files"), GFTP_PORT_ALL,
+   NULL},
   {"refresh_files", N_("Refresh after each file transfer"), 
    gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
    GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
--- a/src/uicommon/gftpui.c	Wed Sep 22 23:38:53 2004 +0000
+++ b/src/uicommon/gftpui.c	Thu Sep 23 01:04:32 2004 +0000
@@ -1276,7 +1276,7 @@
 int
 gftpui_common_transfer_files (gftp_transfer * tdata)
 {
-  intptr_t preserve_permissions, trans_blksize;
+  intptr_t preserve_permissions, preserve_time, trans_blksize;
   struct timeval updatetime;
   ssize_t num_read, ret;
   gftp_file * curfle; 
@@ -1464,14 +1464,16 @@
 
       gftp_lookup_request_option (tdata->fromreq, "preserve_permissions",
                                   &preserve_permissions);
+      gftp_lookup_request_option (tdata->fromreq, "preserve_time",
+                                  &preserve_time);
 
-      if (!curfle->is_fd && preserve_permissions)
+      if (!curfle->is_fd)
         {
-          if (curfle->st_mode != 0)
+          if (preserve_permissions && curfle->st_mode != 0)
             gftp_chmod (tdata->toreq, curfle->destfile,
                         curfle->st_mode & (S_IRWXU | S_IRWXG | S_IRWXO));
 
-          if (curfle->datetime != 0)
+          if (preserve_time && curfle->datetime != 0)
             gftp_set_file_time (tdata->toreq, curfle->destfile,
                                 curfle->datetime);
         }