Discovery: Remove level of indent around moves

No code changes.
This commit is contained in:
Christian Kamm 2019-08-28 14:22:34 +02:00 committed by Kevin Ottens
parent 28797baa39
commit e37e954720
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -900,7 +900,10 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
// If it's not a move it's just a local-NEW
if (!moveCheck()) {
postProcessLocalNew();
} else {
finalize();
return;
}
// Check local permission if we are allowed to put move the file here
// Technically we should use the permissions from the server, but we'll assume it is the same
auto movePerms = checkMovePermissions(base._remotePerm, originalPath, item->isDirectory());
@ -975,9 +978,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
if (base.isVirtualFile() && isVfsWithSuffix())
chopVirtualFileSuffix(serverOriginalPath);
auto job = new RequestEtagJob(_discoveryData->_account, serverOriginalPath, this);
connect(job, &RequestEtagJob::finishedWithResult, this, [=](const HttpResult<QString> &etag) {
auto tmp_path = path;
auto tmp_recurseQueryServer = recurseQueryServer;
connect(job, &RequestEtagJob::finishedWithResult, this, [=](const HttpResult<QString> &etag) mutable {
if (!etag || (*etag != base._etag && !item->isDirectory()) || _discoveryData->isRenamed(originalPath)) {
qCInfo(lcDisco) << "Can't rename because the etag has changed or the directory is gone" << originalPath;
// Can't be a rename, leave it as a new.
@ -985,17 +986,16 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
} else {
// In case the deleted item was discovered in parallel
_discoveryData->findAndCancelDeletedJob(originalPath);
processRename(tmp_path);
tmp_recurseQueryServer = *etag == base._etag ? ParentNotChanged : NormalQuery;
processRename(path);
recurseQueryServer = *etag == base._etag ? ParentNotChanged : NormalQuery;
}
processFileFinalize(item, tmp_path, item->isDirectory(), NormalQuery, tmp_recurseQueryServer);
processFileFinalize(item, path, item->isDirectory(), NormalQuery, recurseQueryServer);
_pendingAsyncJobs--;
QTimer::singleShot(0, _discoveryData, &DiscoveryPhase::scheduleMoreJobs);
});
job->start();
return;
}
}
finalize();
}