diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-11-30 14:20:27 +0300 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-12-15 12:59:27 +0300 |
commit | 96eaef6dbaca2692fed52cde9dc7da6946b15b22 (patch) | |
tree | 7b4e5f84280d5416646beacaaa73d77a770b61fd /src/gui/folder.cpp | |
parent | c253b51249507a5fde345f121ccd06a2c7533b28 (diff) |
Pause sync when remove all dialog is displayed
Fixes: #8263
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r-- | src/gui/folder.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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(); } |