Fix VFS freeze when syncing '.lnk' files on Windows.
authorallexzander <blackslayer4@gmail.com>
Wed, 31 Mar 2021 11:47:34 +0000 (14:47 +0300)
committerallexzander (Rebase PR Action) <allexzander@users.noreply.github.com>
Wed, 7 Apr 2021 09:08:02 +0000 (09:08 +0000)
Signed-off-by: allexzander <blackslayer4@gmail.com>
src/libsync/discovery.cpp

index edded199a7373f40732ba21f41a184cad4d1070b..7d12a8acddb3beb051602c76faf096155a7d4c15 100644 (file)
@@ -501,12 +501,22 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
                 });
             return;
         }
+#ifdef Q_OS_WIN
+        const bool forceAlwaysLocal = item->_type == ItemTypeFile && item->_fileId.endsWith(".lnk");
+#else
+        const bool forceAlwaysLocal = false;
+#endif
+        if (forceAlwaysLocal) {
+            int a = 5;
+            a = 6;
+        }
         // Turn new remote files into virtual files if the option is enabled.
         auto &opts = _discoveryData->_syncOptions;
         if (!localEntry.isValid()
             && item->_type == ItemTypeFile
             && opts._vfs->mode() != Vfs::Off
-            && _pinState != PinState::AlwaysLocal) {
+            && _pinState != PinState::AlwaysLocal
+            && !forceAlwaysLocal) {
             item->_type = ItemTypeVirtualFile;
             if (isVfsWithSuffix())
                 addVirtualFileSuffix(tmp_path._original);