propagator-ng: set the modtime on downloaded files

This commit is contained in:
Olivier Goffart 2013-05-06 12:09:08 +02:00
parent 02957aba45
commit 7f8eba3700

View file

@ -32,6 +32,8 @@
#include <neon/ne_compress.h>
#include <neon/ne_redirect.h>
extern "C" int c_utimes(const char *, const struct timeval *); // this comes from csync
namespace Mirall {
/* Helper for QScopedPointer<>, to be used as the deleter.
@ -467,6 +469,11 @@ csync_instructions_e OwncloudPropagator::downloadFile(const SyncFileItem &item,
tmpFile.setAutoRemove(false);
struct timeval times[2];
times[0].tv_sec = times[1].tv_sec = item._modtime;
times[0].tv_usec = times[1].tv_usec = 0;
c_utimes(item._file.toUtf8().data(), times);
return CSYNC_INSTRUCTION_UPDATED;
}