Skip to content

Commit

Permalink
Emit finished signal if a sync was aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Nov 23, 2023
1 parent e022838 commit 71925b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/11396
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Schedule syncs after an abort

We fixed a bug where the client stopped scheduling syncs after a sync was aborted.

https://github.com/owncloud/client/pull/11396
11 changes: 6 additions & 5 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,18 +857,19 @@ bool SyncEngine::shouldDiscoverLocally(const QString &path) const

void SyncEngine::abort()
{
if (_propagator)
qCInfo(lcEngine) << "Aborting sync";

bool aborting = false;
if (_propagator) {
aborting = true;
// If we're already in the propagation phase, aborting that is sufficient
_propagator->abort();
} else if (_discoveryPhase) {
aborting = true;
// Delete the discovery and all child jobs after ensuring
// it can't finish and start the propagator
disconnect(_discoveryPhase.get(), nullptr, this, nullptr);
_discoveryPhase.release()->deleteLater();

}
if (aborting) {
qCInfo(lcEngine) << "Aborting sync";
if (!_goingDown) {
Q_EMIT syncError(tr("Aborted"));
}
Expand Down

0 comments on commit 71925b5

Please sign in to comment.