auto *subJob = dynamic_cast<PropagatorJob *>(sender());
ASSERT(subJob);
+ if (!_isAnyCaseClashSubFolder) {
+ if (const auto propagateDirectoryjob = qobject_cast<PropagateDirectory *>(subJob)) {
+ _isAnyCaseClashSubFolder = propagateDirectoryjob->_item && propagateDirectoryjob->_item->_isCaseClashFolder;
+ }
+ }
// Delete the job and remove it from our list of jobs.
subJob->deleteLater();
int i = _runningJobs.indexOf(subJob);
}
}
#endif
-
- const auto result = propagator()->updateMetadata(*_item);
- if (!result) {
- status = _item->_status = SyncFileItem::FatalError;
- _item->_errorString = tr("Error updating metadata: %1").arg(result.error());
- qCWarning(lcDirectory) << "Error writing to the database for file" << _item->_file << "with" << result.error();
- } else if (*result == Vfs::ConvertToPlaceholderResult::Locked) {
- _item->_status = SyncFileItem::SoftError;
- _item->_errorString = tr("File is currently in use");
+ if (!_subJobs._isAnyCaseClashSubFolder) {
+ const auto result = propagator()->updateMetadata(*_item);
+ if (!result) {
+ status = _item->_status = SyncFileItem::FatalError;
+ _item->_errorString = tr("Error updating metadata: %1").arg(result.error());
+ qCWarning(lcDirectory) << "Error writing to the database for file" << _item->_file << "with" << result.error();
+ } else if (*result == Vfs::ConvertToPlaceholderResult::Locked) {
+ _item->_status = SyncFileItem::SoftError;
+ _item->_errorString = tr("File is currently in use");
+ }
}
}
}
QVector<PropagatorJob *> _runningJobs;
SyncFileItem::Status _hasError = SyncFileItem::NoStatus; // NoStatus, or NormalError / SoftError if there was an error
quint64 _abortsCount = 0;
+ bool _isAnyCaseClashSubFolder = false;
explicit PropagatorCompositeJob(OwncloudPropagator *propagator)
: PropagatorJob(propagator)
}
if (Utility::fsCasePreserving() && propagator()->localFileNameClash(_item->_file)) {
+ _item->_isCaseClashFolder = true;
qCWarning(lcPropagateLocalMkdir) << "New folder to create locally already exists with different case:" << _item->_file;
done(SyncFileItem::FileNameClash, tr("Folder %1 cannot be created because of a local file or folder name clash!").arg(newDirStr), ErrorCategory::GenericError);
return;
if (QString::compare(_item->_file, _item->_renameTarget, Qt::CaseInsensitive) != 0
&& propagator()->localFileNameClash(_item->_renameTarget)) {
- qCInfo(lcPropagateLocalRename) << "renaming a case clashed file" << _item->_file << _item->_renameTarget;
+ qCInfo(lcPropagateLocalRename) << "renaming a case clashed item" << _item->_file << _item->_renameTarget;
+ if (_item->isDirectory()) {
+ // #HotFix
+ // fix a crash (we can not create a conflicted copy for folders)
+ // right now, the conflict resolution will not even work for this scenario with folders,
+ // but, let's fix it step by step, this will be a second stage
+ done(SyncFileItem::FileNameClash,
+ tr("Folder %1 cannot be renamed because of a local file or folder name clash!").arg(_item->_file),
+ ErrorCategory::GenericError);
+ return;
+ }
const auto caseClashConflictResult = propagator()->createCaseClashConflict(_item, existingFile);
if (caseClashConflictResult) {
done(SyncFileItem::SoftError, *caseClashConflictResult, ErrorCategory::GenericError);
bool _isFileDropDetected = false;
bool _isEncryptedMetadataNeedUpdate = false;
+
+ bool _isCaseClashFolder = false;
};
inline bool operator<(const SyncFileItemPtr &item1, const SyncFileItemPtr &item2)