| Summary: | Copying images destroys file date | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Johannes Stallkamp <jstallkamp> |
| Component: | Database-Scan | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | caulier.gilles |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 8.0.0 | |
| Sentry Crash Report: | |||
|
Description
Johannes Stallkamp
2005-02-21 00:24:46 UTC
CVS commit by pahlibar:
when copying files over, set the file modification time to that of src file
BUG: 99896
M +25 -0 digikamio.cpp 1.11
--- kdeextragear-3/digikam/kioslave/digikamio.cpp #1.10:1.11
@@ -45,4 +45,5 @@ extern "C"
#include <sys/time.h>
#include <time.h>
+#include <utime.h>
#include <errno.h>
#include <sqlite.h>
@@ -412,4 +413,16 @@ void kio_digikamioProtocol::copyInternal
.arg(oldDirID)
.arg(escapeString(src.fileName())) );
+
+ // also set the filetime to that of the original file
+ struct utimbuf t;
+ t.actime = buff_src.st_atime;
+ t.modtime = buff_src.st_mtime;
+
+ if ( ::utime( _dest.data(), &t ) != 0 )
+ {
+ kdWarning() << k_funcinfo
+ << "Failed to set datetime of destination file "
+ << "to that of of original file" << endl;
+ }
}
@@ -447,4 +460,16 @@ void kio_digikamioProtocol::copyInternal
return;
}
+
+ // also set the filetime to that of the original file
+ struct utimbuf t;
+ t.actime = buff_src.st_atime;
+ t.modtime = buff_src.st_mtime;
+
+ if ( ::utime( _dest.data(), &t ) != 0 )
+ {
+ kdWarning() << k_funcinfo
+ << "Failed to set datetime of destination file "
+ << "to that of of original file" << endl;
+ }
}
}
|