From 8ac293bfd44fa93081b2db88dad63abf6dae7e24 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 5 Nov 2024 17:32:53 +0100 Subject: [PATCH] fix migration of existing windows shortcut files to placeholder we cannot do a single call to convert the plain old file to be a dehydrated virtual file placeholder split the conversion into a separate initial API call fix transition from releases < 3.14 to current releases that have first class support for windows shortcuts (so called link files) Signed-off-by: Matthieu Gallien --- src/libsync/propagatedownload.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 9fcc3988fb..b6474ea54d 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -498,6 +498,13 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked() } qCDebug(lcPropagateDownload) << "dehydrating file" << _item->_file; + if (FileSystem::isLnkFile(fsPath)) { + const auto convertResult = vfs->convertToPlaceholder(fsPath, *_item); + if (!convertResult) { + qCCritical(lcPropagateDownload()) << "error when converting a shortcut file to placeholder" << convertResult.error(); + } + } + auto r = vfs->dehydratePlaceholder(*_item); if (!r) { done(SyncFileItem::NormalError, r.error(), ErrorCategory::GenericError);