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.
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user