diff --git a/src/gui/editlocallyjob.cpp b/src/gui/editlocallyjob.cpp index dfb22d44e8717..56de2cb2a38a8 100644 --- a/src/gui/editlocallyjob.cpp +++ b/src/gui/editlocallyjob.cpp @@ -446,12 +446,11 @@ void EditLocallyJob::startEditLocally() if (_folderForFile->isSyncRunning()) { // in case sync is already running - terminate it and start a new one _syncTerminatedConnection = connect(_folderForFile, &Folder::syncFinished, this, [this]() { - _folderForFile->setSilenceErrors(false); disconnect(_syncTerminatedConnection); _syncTerminatedConnection = {}; startSyncBeforeOpening(); }); - _folderForFile->setSilenceErrors(true); + _folderForFile->setSilenceErrorsUntilNextSync(true); _folderForFile->slotTerminateSync(); return; diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 4664fa23a8e5d..3dc9b98cd89b6 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -308,7 +308,7 @@ void Folder::setSyncPaused(bool paused) void Folder::setSyncState(SyncResult::Status state) { - if (_silenceErrors && state == SyncResult::Error) { + if (_silenceErrorsUntilNextSync && state == SyncResult::Error) { _syncResult.setStatus(SyncResult::Status::Success); return; } @@ -836,6 +836,7 @@ bool Folder::reloadExcludes() void Folder::startSync(const QStringList &pathList) { Q_UNUSED(pathList); + setSilenceErrorsUntilNextSync(false); const auto singleItemDiscoveryOptions = _engine->singleItemDiscoveryOptions(); Q_ASSERT(!singleItemDiscoveryOptions.discoveryDirItem || singleItemDiscoveryOptions.discoveryDirItem->isDirectory()); if (singleItemDiscoveryOptions.discoveryDirItem && !singleItemDiscoveryOptions.discoveryDirItem->isDirectory()) { @@ -966,7 +967,7 @@ void Folder::setDirtyNetworkLimits() void Folder::slotSyncError(const QString &message, ErrorCategory category) { - if (!_silenceErrors) { + if (!_silenceErrorsUntilNextSync) { _syncResult.appendErrorString(message); emit ProgressDispatcher::instance()->syncError(alias(), message, category); } @@ -1004,7 +1005,7 @@ void Folder::slotSyncFinished(bool success) if (syncError) { _syncResult.setStatus(SyncResult::Error); - if (_silenceErrors) { + if (_silenceErrorsUntilNextSync) { _syncResult.setStatus(SyncResult::Status::Success); } } else if (_syncResult.foundFilesNotSynced()) { @@ -1160,9 +1161,9 @@ void Folder::slotNextSyncFullLocalDiscovery() _timeSinceLastFullLocalDiscovery.invalidate(); } -void Folder::setSilenceErrors(bool silenceErrors) +void Folder::setSilenceErrorsUntilNextSync(bool silenceErrors) { - _silenceErrors = silenceErrors; + _silenceErrorsUntilNextSync = silenceErrors; } void Folder::schedulePathForLocalDiscovery(const QString &relativePath)