mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
do not capture by default all values in lambdas
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -106,9 +106,9 @@ void ModUpdateDialog::checkCandidates()
|
||||
}
|
||||
|
||||
connect(&check_task, &Task::failed, this,
|
||||
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
[this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
|
||||
connect(&check_task, &Task::succeeded, this, [&]() {
|
||||
connect(&check_task, &Task::succeeded, this, [this, &check_task]() {
|
||||
QStringList warnings = check_task.warnings();
|
||||
if (warnings.count()) {
|
||||
CustomMessageBox::selectable(this, tr("Warnings"), warnings.join('\n'), QMessageBox::Warning)->exec();
|
||||
@ -190,10 +190,14 @@ void ModUpdateDialog::checkCandidates()
|
||||
auto depTask = makeShared<GetModDependenciesTask>(this, m_instance, m_mod_model.get(), selectedVers);
|
||||
|
||||
connect(depTask.get(), &Task::failed, this,
|
||||
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
[this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
|
||||
connect(depTask.get(), &Task::succeeded, this, [&]() {
|
||||
QStringList warnings = depTask->warnings();
|
||||
auto weak = depTask.toWeakRef();
|
||||
connect(depTask.get(), &Task::succeeded, this, [this, weak]() {
|
||||
QStringList warnings;
|
||||
if (auto depTask = weak.lock()) {
|
||||
warnings = depTask->warnings();
|
||||
}
|
||||
if (warnings.count()) {
|
||||
CustomMessageBox::selectable(this, tr("Warnings"), warnings.join('\n'), QMessageBox::Warning)->exec();
|
||||
}
|
||||
@ -273,7 +277,7 @@ auto ModUpdateDialog::ensureMetadata() -> bool
|
||||
bool skip_rest = false;
|
||||
ModPlatform::ResourceProvider provider_rest = ModPlatform::ResourceProvider::MODRINTH;
|
||||
|
||||
auto addToTmp = [&](Mod* m, ModPlatform::ResourceProvider p) {
|
||||
auto addToTmp = [&modrinth_tmp, &flame_tmp](Mod* m, ModPlatform::ResourceProvider p) {
|
||||
switch (p) {
|
||||
case ModPlatform::ResourceProvider::MODRINTH:
|
||||
modrinth_tmp.push_back(m);
|
||||
|
@ -148,10 +148,14 @@ void ResourceDownloadDialog::confirm()
|
||||
QStringList depNames;
|
||||
if (auto task = getModDependenciesTask(); task) {
|
||||
connect(task.get(), &Task::failed, this,
|
||||
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
[this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
|
||||
|
||||
connect(task.get(), &Task::succeeded, this, [&]() {
|
||||
QStringList warnings = task->warnings();
|
||||
auto weak = task.toWeakRef();
|
||||
connect(task.get(), &Task::succeeded, this, [this, weak]() {
|
||||
QStringList warnings;
|
||||
if (auto task = weak.lock()) {
|
||||
warnings = task->warnings();
|
||||
}
|
||||
if (warnings.count()) {
|
||||
CustomMessageBox::selectable(this, tr("Warnings"), warnings.join('\n'), QMessageBox::Warning)->exec();
|
||||
}
|
||||
|
Reference in New Issue
Block a user