[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kioslave/file
From:       David Faure <faure () kde ! org>
Date:       2010-07-23 11:21:13
Message-ID: 20100723112113.EC0ADAC7AB () svn ! kde ! org
[Download RAW message or body]

SVN commit 1153492 by dfaure:

Use utimes rather than utime, in order to preserve milliseconds
 (patch was made for sandsmark in May, finally applying it)


 M  +10 -4     file.cpp  


--- trunk/KDE/kdelibs/kioslave/file/file.cpp #1153491:1153492
@@ -734,10 +734,14 @@
         if ( dt.isValid() ) {
             KDE_struct_stat dest_statbuf;
             if (KDE::stat( dest_orig, &dest_statbuf ) == 0) {
-                struct utimbuf utbuf;
-                utbuf.actime = dest_statbuf.st_atime; // access time, unchanged
-                utbuf.modtime = dt.toTime_t(); // modification time
-                KDE::utime( dest_orig, &utbuf );
+                struct timeval utbuf[2];
+                // access time
+                utbuf[0].tv_sec = dest_statbuf.st_atime; // access time, unchanged  \
## TODO preserve msec +                utbuf[0].tv_usec = 0;
+                // modification time
+                utbuf[1].tv_sec = dt.toTime_t();
+                utbuf[1].tv_usec = dt.time().msec() * 1000;
+                utimes( QFile::encodeName(dest_orig), utbuf );
             }
         }
 
@@ -1315,6 +1319,8 @@
 }
 #endif
 
+// We could port this to KTempDir::removeDir but then we wouldn't be able to tell \
the user +// where exactly the deletion failed, in case of errors.
 bool FileProtocol::deleteRecursive(const QString& path)
 {
     //kDebug() << path;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic