Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
#endif
}
-
-void FileSystem::setFileReadOnlyWeak(const QString &filename, bool readonly)
+bool FileSystem::setFileReadOnlyWeak(const QString &filename, bool readonly)
{
QFile file(filename);
QFile::Permissions permissions = file.permissions();
if (!readonly && (permissions & QFile::WriteOwner)) {
- return; // already writable enough
+ return false; // already writable enough
}
setFileReadOnly(filename, readonly);
+ return true;
}
bool FileSystem::rename(const QString &originFileName,
* This means that it will preserve explicitly set rw-r--r-- permissions even
* when the umask is 0002. (setFileReadOnly() would adjust to rw-rw-r--)
*/
- void OCSYNC_EXPORT setFileReadOnlyWeak(const QString &filename, bool readonly);
+ bool OCSYNC_EXPORT setFileReadOnlyWeak(const QString &filename, bool readonly);
/**
* @brief Try to set permissions so that other users on the local machine can not