From 9c6727e27f55dd888c8cfc5147fdf0f6f8378f46 Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 21 Feb 2022 21:34:06 -0300 Subject: feat: change task container in ModDownloadDialog to a QHash Previously, we used a unique_ptr to a ModDownloadTask to keep track of the selected mod to download when we accepted the dialog. In order to allow multiple mods to be selected at once for download, this has been changed to a QHash where the key is the mods name (since it doesn't seem right to allow for multiple versions of the same mod to be downloaded at once), and the value is a pointer to the corresponding ModDownloadTask. --- launcher/ui/pages/instance/ModFolderPage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'launcher/ui/pages') diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 494d32f0..b342accf 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -365,8 +365,7 @@ void ModFolderPage::on_actionInstall_mods_triggered() } ModDownloadDialog mdownload(m_mods, this, m_inst); if(mdownload.exec()) { - ModDownloadTask *task = mdownload.getTask(); - if (task) { + for(auto task : mdownload.getTasks()){ connect(task, &Task::failed, [this, task](QString reason) { task->deleteLater(); CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show(); -- cgit