fix: fix small issues from review on bulk download job

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2025-08-29 10:12:25 +02:00
parent 1b6c2e6805
commit 571ee0c3bf

View File

@ -126,7 +126,6 @@ void BulkPropagatorDownloadJob::finalizeOneFile(const SyncFileItemPtr &file)
emit propagator()->itemCompleted(file, ErrorCategory::GenericError);
_filesToDownload.erase(foundIt);
}
checkPropagationIsDone();
}
void BulkPropagatorDownloadJob::checkPropagationIsDone()
@ -145,13 +144,12 @@ bool BulkPropagatorDownloadJob::start()
}
for (const auto &fileToDownload : std::as_const(_filesToDownload)) {
Q_ASSERT(fileToDownload->_type == ItemTypeVirtualFileDehydration || fileToDownload->_type == ItemTypeVirtualFile);
Q_ASSERT(fileToDownload->_type == ItemTypeVirtualFile);
if (propagator()->localFileNameClash(fileToDownload->_file)) {
_parentDirJob->appendTask(fileToDownload);
finalizeOneFile(fileToDownload);
qCCritical(lcBulkPropagatorDownloadJob) << "File" << QDir::toNativeSeparators(fileToDownload->_file) << "can not be downloaded because it is non virtual!";
abortWithError(fileToDownload, SyncFileItem::NormalError, tr("File %1 cannot be downloaded because it is non virtual!").arg(QDir::toNativeSeparators(fileToDownload->_file)));
qCWarning(lcBulkPropagatorDownloadJob) << "File" << QDir::toNativeSeparators(fileToDownload->_file) << "can not be downloaded because of a local file name clash!";
abortWithError(fileToDownload, SyncFileItem::FileNameClash, tr("File %1 can not be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(fileToDownload->_file)));
return false;
}
}