@@ -38,8 +38,17 @@ namespace OCC {
38
38
39
39
void PropagateUploadFileV1::doStartUpload ()
40
40
{
41
- if (!propagator ()->account ()->capabilities ().bigfilechunkingEnabled ())
42
- {
41
+ const QString fileName = propagator ()->fullLocalPath (_item->_file );
42
+ // If the file is currently locked, we want to retry the sync
43
+ // when it becomes available again.
44
+ const auto lockMode = propagator ()->syncOptions ().requiredLockMode ();
45
+ if (FileSystem::isFileLocked (fileName, lockMode)) {
46
+ emit propagator ()->seenLockedFile (fileName, lockMode);
47
+ abortWithError (SyncFileItem::SoftError, tr (" %1 the file is currently in use" ).arg (QDir::toNativeSeparators (fileName)));
48
+ return ;
49
+ }
50
+
51
+ if (!propagator ()->account ()->capabilities ().bigfilechunkingEnabled ()) {
43
52
_chunkCount = 1 ;
44
53
} else {
45
54
_chunkCount = int (std::ceil (_item->_size / double (chunkSize ())));
@@ -129,14 +138,6 @@ void PropagateUploadFileV1::startNextChunk()
129
138
}
130
139
131
140
const QString fileName = propagator ()->fullLocalPath (_item->_file );
132
- // If the file is currently locked, we want to retry the sync
133
- // when it becomes available again.
134
- const auto lockMode = propagator ()->syncOptions ().requiredLockMode ();
135
- if (FileSystem::isFileLocked (fileName, lockMode)) {
136
- emit propagator ()->seenLockedFile (fileName, lockMode);
137
- abortWithError (SyncFileItem::SoftError, tr (" %1 the file is currently in use" ).arg (fileName));
138
- return ;
139
- }
140
141
auto device = std::unique_ptr<UploadDevice>(new UploadDevice (
141
142
fileName, chunkStart, currentChunkSize, &propagator ()->_bandwidthManager ));
142
143
if (!device->open (QIODevice::ReadOnly)) {
0 commit comments