mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 06:25:56 +03:00
Wrap all uses of FileSystem::setFolderPermissions in ifdefs for macOS
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
8c7ac5a92d
commit
6f393f1c63
1 changed files with 4 additions and 0 deletions
|
@ -1829,8 +1829,10 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
|
|||
item->_instruction = CSYNC_INSTRUCTION_ERROR;
|
||||
item->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
|
||||
const auto localPath = QString{_discoveryData->_localDir + item->_file};
|
||||
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
|
||||
qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
|
||||
FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
|
||||
#endif
|
||||
return false;
|
||||
} else if (!item->isDirectory() && !perms.hasPermission(RemotePermissions::CanAddFile)) {
|
||||
qCWarning(lcDisco) << "checkForPermission: ERROR" << item->_file;
|
||||
|
@ -2033,8 +2035,10 @@ int ProcessDirectoryJob::processSubJobs(int nbJobs)
|
|||
_dirItem->_instruction = CSYNC_INSTRUCTION_ERROR;
|
||||
_dirItem->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
|
||||
const auto localPath = QString{_discoveryData->_localDir + _dirItem->_file};
|
||||
#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15
|
||||
qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
|
||||
FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
|
||||
#endif
|
||||
}
|
||||
|
||||
_dirItem->_direction = _dirItem->_direction == SyncFileItem::Up ? SyncFileItem::Down : SyncFileItem::Up;
|
||||
|
|
Loading…
Reference in a new issue