Fix clash detection with virtual files
authorHannah von Reth <hannah.vonreth@owncloud.com>
Wed, 13 Jan 2021 13:38:13 +0000 (14:38 +0100)
committerMatthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr>
Wed, 11 Aug 2021 17:13:44 +0000 (17:13 +0000)
Fixes: #8323
src/libsync/propagatedownload.cpp

index f54e41c6803549dd3224e5d7b3d618168c153807..285446ec1f95f372551f90f5c54a92fb2c904028 100644 (file)
@@ -448,6 +448,11 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked()
         }
 
         qCDebug(lcPropagateDownload) << "creating virtual file" << _item->_file;
+        // do a klaas' case clash check.
+        if (propagator()->localFileNameClash(_item->_file)) {
+            done(SyncFileItem::NormalError, tr("File %1 can not be downloaded because of a local file name clash!").arg(QDir::toNativeSeparators(_item->_file)));
+            return;
+        }
         auto r = vfs->createPlaceholder(*_item);
         if (!r) {
             done(SyncFileItem::NormalError, r.error());