mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-29 13:20:18 +02:00
Remove dependencies if review mods is rejected
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
fba2ce3c9f
commit
41d52dc347
@ -133,6 +133,7 @@ void ResourceDownloadDialog::confirm()
|
|||||||
confirm_dialog->retranslateUi(resourcesString());
|
confirm_dialog->retranslateUi(resourcesString());
|
||||||
|
|
||||||
QHash<QString, QStringList> getRequiredBy;
|
QHash<QString, QStringList> getRequiredBy;
|
||||||
|
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(); });
|
||||||
@ -155,8 +156,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;
|
||||||
|
}
|
||||||
getRequiredBy = task->getRequiredBy();
|
getRequiredBy = task->getRequiredBy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,6 +183,9 @@ void ResourceDownloadDialog::confirm()
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->accept();
|
this->accept();
|
||||||
|
} else {
|
||||||
|
for (auto name : depNames)
|
||||||
|
removeResource(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user