Treat .lnk files as normal files without hydrating them or creating a placeholder.
authorallexzander <blackslayer4@gmail.com>
Thu, 1 Apr 2021 13:09:26 +0000 (16:09 +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
src/libsync/vfs/cfapi/vfs_cfapi.cpp

index a24cb4d68184b4ae4c89f322d1d81d3c1116b006..9c3f2d9d003ac1cf55b61b629e21a68702a855a6 100644 (file)
@@ -510,13 +510,13 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
             && item->_type == ItemTypeFile
             && opts._vfs->mode() != Vfs::Off
             && _pinState != PinState::AlwaysLocal
-            ) {
-            item->_type = ItemTypeVirtualFile;
 #ifdef Q_OS_WIN
-            if(FileSystem::isLnkFile(path._server)) {
-                item->_type = ItemTypeVirtualFileDownload;
-            }
+            // on Windows, ".lnk" files are causing troubles with QFileInfo - always treat them as normal files
+            && !FileSystem::isLnkFile(path._server)
 #endif
+            ) {
+            item->_type = ItemTypeVirtualFile;
+
             if (isVfsWithSuffix())
                 addVirtualFileSuffix(tmp_path._original);
         }
index b5b2cb9e2dc4989aa92b9998f01cfe304a5ea72f..d8b96cb41594b6b455de4c849d315e174afa5049 100644 (file)
@@ -197,9 +197,9 @@ bool VfsCfApi::statTypeVirtualFile(csync_file_stat_t *stat, void *statData)
         return true;
     } else if (!isSparseFile && isUnpinned){
         if (!FileSystem::isLnkFile(stat->path)) {
-                stat->type = ItemTypeVirtualFileDehydration;
+            stat->type = ItemTypeVirtualFileDehydration;
+            return true;
         }
-        return true;
     } else if (isSparseFile) {
         stat->type = ItemTypeVirtualFile;
         return true;