diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-11-26 03:06:58 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-11-26 03:06:58 +0100 |
commit | 3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0 (patch) | |
tree | fb18293c796fb60595271c603cdcdd705e0b4b72 /api/logic/minecraft/update/LibrariesTask.cpp | |
parent | e8c382bede6a23648339b7d3f290137f9265a7ba (diff) | |
download | MultiMC-3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0.tar MultiMC-3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0.tar.gz MultiMC-3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0.tar.lz MultiMC-3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0.tar.xz MultiMC-3f6aecf5a2cca0330af3f55ddbb3d7e13e2419c0.zip |
GH-2475 fix reporting missing local libraries on launch
Diffstat (limited to 'api/logic/minecraft/update/LibrariesTask.cpp')
-rw-r--r-- | api/logic/minecraft/update/LibrariesTask.cpp | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/api/logic/minecraft/update/LibrariesTask.cpp b/api/logic/minecraft/update/LibrariesTask.cpp index 6dcb149c..56fa1fc4 100644 --- a/api/logic/minecraft/update/LibrariesTask.cpp +++ b/api/logic/minecraft/update/LibrariesTask.cpp @@ -22,42 +22,32 @@ void LibrariesTask::executeTask() downloadJob.reset(job); auto metacache = ENV.metacache(); - QList<LibraryPtr> brokenLocalLibs; - QStringList failedFiles; - auto createJob = [&](const LibraryPtr & lib) + QStringList failedLocalFiles; + + QList<LibraryPtr> artifactPool; + artifactPool.append(profile->getLibraries()); + artifactPool.append(profile->getNativeLibraries()); + artifactPool.append(profile->getJarMods()); + artifactPool.append(profile->getMainJar()); + for (auto lib : artifactPool) { if(!lib) { emitFailed(tr("Null jar is specified in the metadata, aborting.")); return; } - auto dls = lib->getDownloads(currentSystem, metacache.get(), failedFiles, inst->getLocalLibraryPath()); + auto dls = lib->getDownloads(currentSystem, metacache.get(), failedLocalFiles, inst->getLocalLibraryPath()); for(auto dl : dls) { downloadJob->addNetAction(dl); } - }; - auto createJobs = [&](const QList<LibraryPtr> & libs) - { - for (auto lib : libs) - { - createJob(lib); - } - }; - createJobs(profile->getLibraries()); - createJobs(profile->getNativeLibraries()); - createJobs(profile->getJarMods()); - createJob(profile->getMainJar()); + } - // FIXME: this is never filled!!!! - if (!brokenLocalLibs.empty()) + if (!failedLocalFiles.empty()) { downloadJob.reset(); - QString failed_all = failedFiles.join("\n"); - emitFailed(tr("Some libraries marked as 'local' are missing their jar " - "files:\n%1\n\nYou'll have to correct this problem manually. If this is " - "an externally tracked instance, make sure to run it at least once " - "outside of MultiMC.").arg(failed_all)); + QString failed_all = failedLocalFiles.join("\n"); + emitFailed(tr("Some libraries marked as 'local' are missing their jar files:\n%1\n\nYou'll have to correct this problem manually.").arg(failed_all)); return; } connect(downloadJob.get(), &NetJob::succeeded, this, &LibrariesTask::emitSucceeded); |