Unify else and if in SyncEngine::slotItemDiscovered for filesystem setmodtime check

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-07-07 19:11:59 +08:00
parent 0a86967f14
commit 32145342c8

View File

@ -394,13 +394,11 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
emit itemCompleted(item, ErrorCategory::GenericError);
return;
}
} else {
if (!FileSystem::setModTime(filePath, item->_modtime)) {
item->_instruction = CSYNC_INSTRUCTION_ERROR;
item->_errorString = tr("Could not update file metadata: %1").arg(filePath);
emit itemCompleted(item, ErrorCategory::GenericError);
return;
}
} else if (!FileSystem::setModTime(filePath, item->_modtime)) {
item->_instruction = CSYNC_INSTRUCTION_ERROR;
item->_errorString = tr("Could not update file metadata: %1").arg(filePath);
emit itemCompleted(item, ErrorCategory::GenericError);
return;
}
// Updating the db happens on success