feat: add mod index updating to ModDownloadTask

This makes ModDownloadTask into a SequentialTask with 2 subtasks:
Downloading the mod files and updating the index with the new
information.

The index updating is done first so that, in the future, we
can prompt the user before download if, for instance, we discover
there's another version already installed.
This commit is contained in:
flow
2022-04-13 19:18:28 -03:00
committed by flow
parent b30b88716e
commit c86c719e1a
3 changed files with 25 additions and 28 deletions

View File

@ -150,7 +150,7 @@ void ModPage::onModSelected()
if (dialog->isModSelected(current.name, version.fileName)) {
dialog->removeSelectedMod(current.name);
} else {
dialog->addSelectedMod(current.name, new ModDownloadTask(version.downloadUrl, version.fileName, dialog->mods));
dialog->addSelectedMod(current.name, new ModDownloadTask(current, version, dialog->mods));
}
updateSelectionButton();