Bladeren bron

Don't convert exclude file to placeholder file

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
Felix Weilbach 4 jaren geleden
bovenliggende
commit
650578ee64
1 gewijzigde bestanden met toevoegingen van 12 en 2 verwijderingen
  1. 12 2
      src/libsync/syncengine.cpp

+ 12 - 2
src/libsync/syncengine.cpp

@@ -15,6 +15,7 @@
 
 #include "syncengine.h"
 #include "account.h"
+#include "common/filesystembase.h"
 #include "owncloudpropagator.h"
 #include "common/syncjournaldb.h"
 #include "common/syncjournalfilerecord.h"
@@ -53,6 +54,7 @@
 #include <QSslCertificate>
 #include <QProcess>
 #include <QElapsedTimer>
+#include <QFileInfo>
 #include <qtextcodec.h>
 
 namespace OCC {
@@ -1023,9 +1025,17 @@ void SyncEngine::switchToVirtualFiles(const QString &localPath, SyncJournalDb &j
 {
     qCInfo(lcEngine) << "Convert to virtual files inside" << localPath;
     journal.getFilesBelowPath({}, [&](const SyncJournalFileRecord &rec) {
+        const auto path = rec.path();
+        const auto fileName = QFileInfo(path).fileName();
+        if (FileSystem::isExcludeFile(fileName)) {
+            return;
+        }
         SyncFileItem item;
-        QString localFile = localPath + rec.path();
-        vfs.convertToPlaceholder(localFile, item, localFile);
+        QString localFile = localPath + path;
+        const auto result = vfs.convertToPlaceholder(localFile, item, localFile);
+        if (!result.isValid()) {
+            qCWarning(lcEngine) << "Could not convert file to placeholder" << result.error();
+        }
     });
 }