From: Matthieu Gallien Date: Tue, 5 Nov 2024 16:32:53 +0000 (+0100) Subject: fix migration of existing windows shortcut files to placeholder X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~13^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8ac293bfd44fa93081b2db88dad63abf6dae7e24;p=nextcloud-desktop.git 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 --- diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 9fcc3988f..b6474ea54 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);