From: Hannah von Reth Date: Mon, 30 Nov 2020 11:20:27 +0000 (+0100) Subject: Pause sync when remove all dialog is displayed X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=96eaef6dbaca2692fed52cde9dc7da6946b15b22;p=nextcloud-desktop.git Pause sync when remove all dialog is displayed Fixes: #8263 --- diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 376a58d60..c542de947 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1247,15 +1247,18 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::functio msgBox->setWindowFlags(msgBox->windowFlags() | Qt::WindowStaysOnTopHint); msgBox->addButton(tr("Remove all files"), QMessageBox::DestructiveRole); QPushButton *keepBtn = msgBox->addButton(tr("Keep files"), QMessageBox::AcceptRole); - connect(msgBox, &QMessageBox::finished, this, [msgBox, keepBtn, callback, this]{ + bool oldPaused = syncPaused(); + setSyncPaused(true); + connect(msgBox, &QMessageBox::finished, this, [msgBox, keepBtn, callback, oldPaused, this] { const bool cancel = msgBox->clickedButton() == keepBtn; callback(cancel); if (cancel) { FileSystem::setFolderMinimumPermissions(path()); - journalDb()->clearFileTable(); - _lastEtag.clear(); - slotScheduleThisFolder(); + journalDb()->clearFileTable(); + _lastEtag.clear(); + slotScheduleThisFolder(); } + setSyncPaused(oldPaused); }); msgBox->open(); }