mirror of
https://github.com/zealdocs/zeal.git
synced 2026-08-29 16:40:51 +08:00
ui: Fix a race condition when removing docsets (#624)
This commit is contained in:
@@ -707,12 +707,7 @@ void DocsetsDialog::removeDocset(const QString &name)
|
||||
return;
|
||||
}
|
||||
|
||||
QFuture<bool> future = QtConcurrent::run([tmpPath] {
|
||||
return QDir(tmpPath).removeRecursively();
|
||||
});
|
||||
|
||||
QFutureWatcher<bool> *watcher = new QFutureWatcher<bool>();
|
||||
watcher->setFuture(future);
|
||||
connect(watcher, &QFutureWatcher<void>::finished, [=] {
|
||||
if (!watcher->result()) {
|
||||
QMessageBox::warning(this, QStringLiteral("Zeal"),
|
||||
@@ -727,6 +722,10 @@ void DocsetsDialog::removeDocset(const QString &name)
|
||||
|
||||
m_docsetsBeingDeleted.removeOne(name);
|
||||
});
|
||||
|
||||
watcher->setFuture(QtConcurrent::run([tmpPath] {
|
||||
return QDir(tmpPath).removeRecursively();
|
||||
}));
|
||||
}
|
||||
|
||||
void DocsetsDialog::updateCombinedProgress()
|
||||
|
||||
Reference in New Issue
Block a user