Merge pull request #2173 from Trial97/dependency_removal
Remove dependencies if review mods is rejected
This commit is contained in:
commit
7ff173d72a
@ -145,6 +145,7 @@ void ResourceDownloadDialog::confirm()
|
|||||||
confirm_dialog->retranslateUi(resourcesString());
|
confirm_dialog->retranslateUi(resourcesString());
|
||||||
|
|
||||||
QHash<QString, GetModDependenciesTask::PackDependencyExtraInfo> dependencyExtraInfo;
|
QHash<QString, GetModDependenciesTask::PackDependencyExtraInfo> dependencyExtraInfo;
|
||||||
|
QStringList depNames;
|
||||||
if (auto task = getModDependenciesTask(); task) {
|
if (auto task = getModDependenciesTask(); task) {
|
||||||
connect(task.get(), &Task::failed, this,
|
connect(task.get(), &Task::failed, this,
|
||||||
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||||
@ -167,8 +168,10 @@ void ResourceDownloadDialog::confirm()
|
|||||||
QMetaObject::invokeMethod(this, "reject", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "reject", Qt::QueuedConnection);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
for (auto dep : task->getDependecies())
|
for (auto dep : task->getDependecies()) {
|
||||||
addResource(dep->pack, dep->version);
|
addResource(dep->pack, dep->version);
|
||||||
|
depNames << dep->pack->name;
|
||||||
|
}
|
||||||
dependencyExtraInfo = task->getExtraInfo();
|
dependencyExtraInfo = task->getExtraInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,6 +196,9 @@ void ResourceDownloadDialog::confirm()
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->accept();
|
this->accept();
|
||||||
|
} else {
|
||||||
|
for (auto name : depNames)
|
||||||
|
removeResource(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user