Browse Source

Fix clash detection with virtual files

Fixes: #8323
Hannah von Reth 5 years ago
parent
commit
6e0a43b570
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/libsync/propagatedownload.cpp

+ 5 - 0
src/libsync/propagatedownload.cpp

@@ -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());