|
@@ -1200,17 +1200,14 @@ void PropagateDownloadFile::downloadFinished()
|
|
|
|
|
|
|
|
if (_item->_locked == SyncFileItem::LockStatus::LockedItem && (_item->_lockOwnerType != SyncFileItem::LockOwnerType::UserLock || _item->_lockOwnerId != propagator()->account()->davUser())) {
|
|
if (_item->_locked == SyncFileItem::LockStatus::LockedItem && (_item->_lockOwnerType != SyncFileItem::LockOwnerType::UserLock || _item->_lockOwnerId != propagator()->account()->davUser())) {
|
|
|
qCDebug(lcPropagateDownload()) << _tmpFile << "file is locked: making it read only";
|
|
qCDebug(lcPropagateDownload()) << _tmpFile << "file is locked: making it read only";
|
|
|
- FileSystem::setFileReadOnly(filename, true);
|
|
|
|
|
|
|
+ FileSystem::setFileReadOnly(_tmpFile.fileName(), true);
|
|
|
} else {
|
|
} else {
|
|
|
qCDebug(lcPropagateDownload()) << _tmpFile << "file is not locked: making it"
|
|
qCDebug(lcPropagateDownload()) << _tmpFile << "file is not locked: making it"
|
|
|
<< ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only"
|
|
<< ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only"
|
|
|
: "read write");
|
|
: "read write");
|
|
|
- FileSystem::setFileReadOnlyWeak(filename, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
|
|
|
|
|
|
|
+ FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(), (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Apply the remote permissions
|
|
|
|
|
- FileSystem::setFileReadOnlyWeak(_tmpFile.fileName(), !_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite));
|
|
|
|
|
-
|
|
|
|
|
const auto isConflict = (_item->_instruction == CSYNC_INSTRUCTION_CONFLICT
|
|
const auto isConflict = (_item->_instruction == CSYNC_INSTRUCTION_CONFLICT
|
|
|
&& (QFileInfo(filename).isDir() || !FileSystem::fileEquals(filename, _tmpFile.fileName()))) ||
|
|
&& (QFileInfo(filename).isDir() || !FileSystem::fileEquals(filename, _tmpFile.fileName()))) ||
|
|
|
_item->_instruction == CSYNC_INSTRUCTION_CASE_CLASH_CONFLICT;
|
|
_item->_instruction == CSYNC_INSTRUCTION_CASE_CLASH_CONFLICT;
|