From: allexzander Date: Wed, 31 Mar 2021 13:36:13 +0000 (+0300) Subject: Added .lnk file placeholder creation fix. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~275^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7235c708dced0e4c6262e8ac3fae23d9e303b609;p=nextcloud-desktop.git Added .lnk file placeholder creation fix. Signed-off-by: allexzander --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 7d12a8acd..47b4f2cf5 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -14,6 +14,9 @@ #include "discovery.h" #include "common/syncjournaldb.h" +#ifdef Q_OS_WIN +#include "common/filesystembase.h" +#endif #include "syncfileitem.h" #include #include @@ -501,22 +504,16 @@ 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 - && !forceAlwaysLocal) { +#ifdef Q_OS_WIN + && !FileSystem::isLnkFile(path._server) +#endif + ) { item->_type = ItemTypeVirtualFile; if (isVfsWithSuffix()) addVirtualFileSuffix(tmp_path._original); diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index f6a23261a..086da5cac 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -345,7 +345,11 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item) rec._serverHasIgnoredFiles |= prev._serverHasIgnoredFiles; // Ensure it's a placeholder file on disk - if (item->_type == ItemTypeFile) { + if (item->_type == ItemTypeFile +#ifdef Q_OS_WIN + && !FileSystem::isLnkFile(filePath) +#endif + ) { const auto result = _syncOptions._vfs->convertToPlaceholder(filePath, *item); if (!result) { item->_instruction = CSYNC_INSTRUCTION_ERROR;