From 13f4bb541d0a675daf347c352cf758ef8a8db0c6 Mon Sep 17 00:00:00 2001 From: allexzander Date: Thu, 1 Apr 2021 16:09:26 +0300 Subject: [PATCH] Treat .lnk files as normal files without hydrating them or creating a placeholder. Signed-off-by: allexzander --- src/libsync/discovery.cpp | 10 +++++----- src/libsync/vfs/cfapi/vfs_cfapi.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index a24cb4d68..9c3f2d9d0 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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); } diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp index b5b2cb9e2..d8b96cb41 100644 --- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp +++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp @@ -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; -- 2.30.2