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 <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-11-05 17:32:53 +01:00
parent 3c021166fa
commit 8ac293bfd4
No known key found for this signature in database
GPG Key ID: 7D0F74F05C22F553

View File

@ -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);