mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-17 11:21:51 +03:00
propagator-ng: set the modtime on downloaded files
This commit is contained in:
parent
02957aba45
commit
7f8eba3700
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue