|
|
@@ -1198,6 +1198,16 @@ void PropagateDownloadFile::downloadFinished()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ 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";
|
|
|
+ FileSystem::setFileReadOnly(filename, true);
|
|
|
+ } else {
|
|
|
+ qCDebug(lcPropagateDownload()) << _tmpFile << "file is not locked: making it"
|
|
|
+ << ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only"
|
|
|
+ : "read write");
|
|
|
+ FileSystem::setFileReadOnly(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));
|
|
|
|
|
|
@@ -1262,12 +1272,6 @@ void PropagateDownloadFile::downloadFinished()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- qCInfo(lcPropagateDownload()) << propagator()->account()->davUser() << propagator()->account()->davDisplayName() << propagator()->account()->displayName();
|
|
|
- if (_item->_locked == SyncFileItem::LockStatus::LockedItem && (_item->_lockOwnerType != SyncFileItem::LockOwnerType::UserLock || _item->_lockOwnerId != propagator()->account()->davUser())) {
|
|
|
- qCInfo(lcPropagateDownload()) << "file is locked: making it read only";
|
|
|
- FileSystem::setFileReadOnly(filename, true);
|
|
|
- }
|
|
|
-
|
|
|
FileSystem::setFileHidden(filename, false);
|
|
|
|
|
|
// Maybe we downloaded a newer version of the file than we thought we would...
|
|
|
@@ -1346,6 +1350,14 @@ void PropagateDownloadFile::updateMetadata(bool isConflict)
|
|
|
handleRecallFile(fn, propagator()->localPath(), *propagator()->_journal);
|
|
|
}
|
|
|
|
|
|
+ if (_item->_locked == SyncFileItem::LockStatus::LockedItem && (_item->_lockOwnerType != SyncFileItem::LockOwnerType::UserLock || _item->_lockOwnerId != propagator()->account()->davUser())) {
|
|
|
+ qCDebug(lcPropagateDownload()) << fn << "file is locked: making it read only";
|
|
|
+ FileSystem::setFileReadOnly(fn, true);
|
|
|
+ } else {
|
|
|
+ qCDebug(lcPropagateDownload()) << fn << "file is not locked: making it" << ((!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)) ? "read only" : "read write");
|
|
|
+ FileSystem::setFileReadOnly(fn, (!_item->_remotePerm.isNull() && !_item->_remotePerm.hasPermission(RemotePermissions::CanWrite)));
|
|
|
+ }
|
|
|
+
|
|
|
qint64 duration = _stopwatch.elapsed();
|
|
|
if (isLikelyFinishedQuickly() && duration > 5 * 1000) {
|
|
|
qCWarning(lcPropagateDownload) << "WARNING: Unexpectedly slow connection, took" << duration << "msec for" << _item->_size - _resumeStart << "bytes for" << _item->_file;
|