| 85 | } |
| 86 | |
| 87 | void FMLLibrariesTask::fmllibsFinished() |
| 88 | { |
| 89 | downloadJob.reset(); |
| 90 | if (!fmlLibsToProcess.isEmpty()) |
| 91 | { |
| 92 | setStatus(tr("Copying FML libraries into the instance...")); |
| 93 | MinecraftInstance *inst = (MinecraftInstance *)m_inst; |
| 94 | auto metacache = APPLICATION->metacache(); |
| 95 | int index = 0; |
| 96 | for (auto &lib : fmlLibsToProcess) |
| 97 | { |
| 98 | progress(index, fmlLibsToProcess.size()); |
| 99 | auto entry = metacache->resolveEntry("fmllibs", lib.filename); |
| 100 | auto path = FS::PathCombine(inst->libDir(), lib.filename); |
| 101 | if (!FS::ensureFilePathExists(path)) |
| 102 | { |
| 103 | emitFailed(tr("Failed creating FML library folder inside the instance.")); |
| 104 | return; |
| 105 | } |
| 106 | if (!QFile::copy(entry->getFullPath(), FS::PathCombine(inst->libDir(), lib.filename))) |
| 107 | { |
| 108 | emitFailed(tr("Failed copying Forge/FML library: %1.").arg(lib.filename)); |
| 109 | return; |
| 110 | } |
| 111 | index++; |
| 112 | } |
| 113 | progress(index, fmlLibsToProcess.size()); |
| 114 | } |
| 115 | emitSucceeded(); |
| 116 | } |
| 117 | void FMLLibrariesTask::fmllibsFailed(QString reason) |
| 118 | { |
| 119 | QStringList failed = downloadJob->getFailedFiles(); |
nothing calls this directly
no test coverage detected