mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 12:19:03 +03:00
Ensure file modification time is set if item modtime differs from journal modtime
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
961033efc1
commit
4681d27de5
1 changed files with 11 additions and 11 deletions
|
@ -388,8 +388,7 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update on-disk virtual file metadata
|
// Update on-disk virtual file metadata
|
||||||
if (modificationHappened) {
|
if (modificationHappened && item->_type == ItemTypeVirtualFile) {
|
||||||
if (item->_type == ItemTypeVirtualFile) {
|
|
||||||
auto r = _syncOptions._vfs->updateMetadata(filePath, item->_modtime, item->_size, item->_fileId);
|
auto r = _syncOptions._vfs->updateMetadata(filePath, item->_modtime, item->_size, item->_fileId);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
item->_status = SyncFileItem::Status::NormalError;
|
item->_status = SyncFileItem::Status::NormalError;
|
||||||
|
@ -398,7 +397,8 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
|
||||||
emit itemCompleted(item, ErrorCategory::GenericError);
|
emit itemCompleted(item, ErrorCategory::GenericError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (!FileSystem::setModTime(filePath, item->_modtime)) {
|
} else if (modificationHappened || prev._modtime != item->_modtime) {
|
||||||
|
if (!FileSystem::setModTime(filePath, item->_modtime)) {
|
||||||
item->_instruction = CSYNC_INSTRUCTION_ERROR;
|
item->_instruction = CSYNC_INSTRUCTION_ERROR;
|
||||||
item->_errorString = tr("Could not update file metadata: %1").arg(filePath);
|
item->_errorString = tr("Could not update file metadata: %1").arg(filePath);
|
||||||
emit itemCompleted(item, ErrorCategory::GenericError);
|
emit itemCompleted(item, ErrorCategory::GenericError);
|
||||||
|
|
Loading…
Reference in a new issue