Merge branch 'fail_concurrent_task' of github.com:Trial97/PrismLauncher into concurrent

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-10-18 18:08:31 +03:00
17 changed files with 80 additions and 26 deletions

View File

@ -207,6 +207,10 @@ void ResourceModel::loadEntry(QModelIndex& entry)
return;
versionRequestSucceeded(doc, pack, entry);
};
if (!callbacks.on_fail)
callbacks.on_fail = [](QString reason, int) {
QMessageBox::critical(nullptr, tr("Error"), tr("A network error occurred. Could not load project versions:%1").arg(reason));
};
if (auto job = m_api->getProjectVersions(std::move(args), std::move(callbacks)); job)
runInfoJob(job);