From: Olivier Goffart Date: Mon, 7 Oct 2019 08:49:23 +0000 (+0200) Subject: Fix warning about serverJob not being used X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~175 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=adbd3d869b80b3a9360f4fae87da665b571178c2;p=nextcloud-desktop.git Fix warning about serverJob not being used And fix a FIXME in the same time --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 275a77036..d2d562d5a 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -36,9 +36,8 @@ void ProcessDirectoryJob::start() { qCInfo(lcDisco) << "STARTING" << _currentFolder._server << _queryServer << _currentFolder._local << _queryLocal; - DiscoverySingleDirectoryJob *serverJob = nullptr; if (_queryServer == NormalQuery) { - serverJob = startAsyncServerQuery(); + _serverJob = startAsyncServerQuery(); } else { _serverQueryDone = true; } @@ -57,8 +56,6 @@ void ProcessDirectoryJob::start() _localQueryDone = true; } - // FIXME: serverJob->abort() if local failed..? This used to be in code before - if (_localQueryDone && _serverQueryDone) { process(); } @@ -1448,6 +1445,8 @@ void ProcessDirectoryJob::startAsyncLocalQuery() connect(localJob, &DiscoverySingleLocalDirectoryJob::finishedFatalError, this, [this](const QString &msg) { _discoveryData->_currentlyActiveJobs--; _pendingAsyncJobs--; + if (_serverJob) + _serverJob->abort(); emit _discoveryData->fatalError(msg); });