1
0
Fork 0

Launcher: don’t update already updating aircraft

This commit is contained in:
James Turner 2018-10-04 21:22:05 +01:00
parent abbaf8f640
commit 1c08ca0e2d

View file

@ -660,9 +660,13 @@ void LauncherController::requestInstallCancel(QUrl aircraftUri)
void LauncherController::requestUpdateAllAircraft()
{
const PackageList& toBeUpdated = globals->packageRoot()->packagesNeedingUpdate();
std::for_each(toBeUpdated.begin(), toBeUpdated.end(), [](PackageRef pkg) {
globals->packageRoot()->scheduleToUpdate(pkg->install());
const auto pkgRoot = globals->packageRoot();
const PackageList& toBeUpdated = pkgRoot->packagesNeedingUpdate();
std::for_each(toBeUpdated.begin(), toBeUpdated.end(), [pkgRoot](PackageRef pkg) {
const auto ins = pkg->install();
if (!pkgRoot->isInstallQueued(ins)) {
pkgRoot->scheduleToUpdate(ins);
}
});
}