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 <matthieu.gallien@nextcloud.com>
}
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);
VfsCfApi::HydratationAndPinStates VfsCfApi::computeRecursiveHydrationAndPinStates(const QString &folderPath, const Optional<PinState> &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)) {