mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 22:15:57 +03:00
Discovery: fix double emission of finished in case of error
This commit is contained in:
parent
7061f31887
commit
b79e57d1c1
2 changed files with 8 additions and 5 deletions
|
@ -1149,8 +1149,6 @@ int ProcessDirectoryJob::processSubJobs(int nbJobs)
|
|||
void ProcessDirectoryJob::dbError()
|
||||
{
|
||||
_discoveryData->fatalError(tr("Error while reading the database"));
|
||||
_pendingAsyncJobs = -1; // We're finished, we don't want to emit finished again
|
||||
emit finished();
|
||||
}
|
||||
|
||||
void ProcessDirectoryJob::addVirtualFileSuffix(QString &str) const
|
||||
|
@ -1214,7 +1212,6 @@ DiscoverySingleDirectoryJob *ProcessDirectoryJob::startAsyncServerQuery()
|
|||
}
|
||||
emit _discoveryData->fatalError(tr("Server replied with an error while reading directory '%1' : %2")
|
||||
.arg(_currentFolder._server, results.errorMessage()));
|
||||
emit finished();
|
||||
}
|
||||
});
|
||||
connect(serverJob, &DiscoverySingleDirectoryJob::firstDirectoryPermissions, this,
|
||||
|
@ -1248,7 +1245,6 @@ bool ProcessDirectoryJob::runLocalQuery()
|
|||
return true;
|
||||
}
|
||||
emit _discoveryData->fatalError(errorString);
|
||||
emit finished();
|
||||
return false;
|
||||
}
|
||||
errno = 0;
|
||||
|
@ -1283,7 +1279,6 @@ bool ProcessDirectoryJob::runLocalQuery()
|
|||
// Note: Windows vio converts any error into EACCES
|
||||
qCWarning(lcDisco) << "readdir failed for file in " << _currentFolder._local << " - errno: " << errno;
|
||||
emit _discoveryData->fatalError(tr("Error while reading directory %1").arg(_discoveryData->_localDir + _currentFolder._local));
|
||||
emit finished();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -642,6 +642,11 @@ void SyncEngine::slotNewItem(const SyncFileItemPtr &item)
|
|||
|
||||
void SyncEngine::slotDiscoveryJobFinished()
|
||||
{
|
||||
if (!_discoveryPhase) {
|
||||
// There was an error that was already taken care of
|
||||
return;
|
||||
}
|
||||
|
||||
qCInfo(lcEngine) << "#### Discovery end #################################################### " << _stopWatch.addLapTime(QLatin1String("Discovery Finished")) << "ms";
|
||||
|
||||
// Sanity check
|
||||
|
@ -817,6 +822,9 @@ void SyncEngine::finalize(bool success)
|
|||
qCInfo(lcEngine) << "Sync run took " << _stopWatch.addLapTime(QLatin1String("Sync Finished")) << "ms";
|
||||
_stopWatch.stop();
|
||||
|
||||
if (_discoveryPhase) {
|
||||
_discoveryPhase.take()->deleteLater();
|
||||
}
|
||||
s_anySyncRunning = false;
|
||||
_syncRunning = false;
|
||||
emit finished(success);
|
||||
|
|
Loading…
Reference in a new issue