Add oneshot option

This commit is contained in:
woblight
2025-01-28 19:10:00 +01:00
parent 0429a444ac
commit c98a505fbc
5 changed files with 40 additions and 3 deletions
+16
View File
@@ -766,3 +766,19 @@ void Control::log(QtMsgType type, const QMessageLogContext& context, const QStri
emit logMessage(message.arg(color, msg));
}
void Control::updateAllAndClose()
{
delegate("UpdateAllAndClose", [](){
},[this](){
std::vector<QFuture<void>> futs(m_addons.size());
foreach (auto addon, m_addons) {
futs.push_back(addon->updateIfBehind());
}
delegate("WaitForFinish", [this, futs](){
foreach(auto fut, futs)
fut.waitForFinished();
QApplication::quit();
});
});
}