From: Matthieu Gallien Date: Tue, 5 Nov 2024 22:09:00 +0000 (+0100) Subject: ensure lnk shortcut files are converted to virtual files X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~13^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=85e71d47bfa64c3293afc2b88eff7e72dbfce3c3;p=nextcloud-desktop.git ensure lnk shortcut files are converted to virtual files Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 3fe2fb2d8..f4a98b518 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1731,6 +1731,15 @@ void ProcessDirectoryJob::processFileFinalize( item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_UPDATE_VFS_METADATA; } + if (_discoveryData->_syncOptions._vfs && + (item->_type == CSyncEnums::ItemTypeFile || item->_type == CSyncEnums::ItemTypeDirectory) && + item->_instruction == CSyncEnums::CSYNC_INSTRUCTION_NONE && + FileSystem::isLnkFile((_discoveryData->_localDir + path._local))) { + item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_SYNC; + item->_direction = SyncFileItem::Down; + item->_type = CSyncEnums::ItemTypeVirtualFileDehydration; + } + if (path._original != path._target && (item->_instruction == CSYNC_INSTRUCTION_UPDATE_VFS_METADATA || item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA || item->_instruction == CSYNC_INSTRUCTION_NONE)) { ASSERT(_dirItem && _dirItem->_instruction == CSYNC_INSTRUCTION_RENAME); // This is because otherwise subitems are not updated! (ideally renaming a directory could