From: Matthieu Gallien Date: Wed, 30 Oct 2024 15:37:42 +0000 (+0100) Subject: do not move to trash online only files/folders: going to fail X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~13^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=efe686992e32aedf670c5b286725451f639f7f15;p=nextcloud-desktop.git do not move to trash online only files/folders: going to fail ensure that even if move to trash is enabled, we do not erroneously try to move online only files or folders to trash bin Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp index bcdf5a469..8b397f033 100644 --- a/src/libsync/propagatorjobs.cpp +++ b/src/libsync/propagatorjobs.cpp @@ -117,7 +117,8 @@ void PropagateLocalRemove::start() } QString removeError; - if (_moveToTrash) { + const auto availability = propagator()->syncOptions()._vfs->availability(_item->_file, Vfs::AvailabilityRecursivity::RecursiveAvailability); + if (_moveToTrash && (!availability || (*availability != VfsItemAvailability::AllDehydrated && *availability != VfsItemAvailability::OnlineOnly && *availability != VfsItemAvailability::Mixed))) { if ((QDir(filename).exists() || FileSystem::fileExists(filename)) && !FileSystem::moveToTrash(filename, &removeError)) { done(SyncFileItem::NormalError, removeError, ErrorCategory::GenericError); diff --git a/src/libsync/vfs/cfapi/vfs_cfapi.cpp b/src/libsync/vfs/cfapi/vfs_cfapi.cpp index 414caed1b..7ae45a6d2 100644 --- a/src/libsync/vfs/cfapi/vfs_cfapi.cpp +++ b/src/libsync/vfs/cfapi/vfs_cfapi.cpp @@ -511,7 +511,7 @@ int VfsCfApi::finalizeHydrationJob(const QString &requestId) VfsCfApi::HydratationAndPinStates VfsCfApi::computeRecursiveHydrationAndPinStates(const QString &folderPath, const Optional &basePinState) { Q_ASSERT(!folderPath.endsWith('/')); - const auto fullPath = params().filesystemPath + folderPath; + const auto fullPath = QString{params().filesystemPath + folderPath}; QFileInfo info(params().filesystemPath + folderPath); if (!FileSystem::fileExists(fullPath)) {