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