MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / finalizeComponents

Method finalizeComponents

launcher/minecraft/ComponentUpdateTask.cpp:660–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void ComponentUpdateTask::finalizeComponents()
661{
662 auto& components = d->m_profile->d->components;
663 auto& componentIndex = d->m_profile->d->componentIndex;
664 for (auto component : components) {
665 for (auto req : component->m_cachedRequires) {
666 auto found = componentIndex.find(req.uid);
667 if (found == componentIndex.cend()) {
668 component->addComponentProblem(
669 ProblemSeverity::Error,
670 QObject::tr("%1 is missing requirement %2 %3")
671 .arg(component->getName(), req.uid, req.equalsVersion.isEmpty() ? req.suggests : req.equalsVersion));
672 } else {
673 auto reqComp = *found;
674 if (!reqComp->getProblems().isEmpty()) {
675 component->addComponentProblem(
676 reqComp->getProblemSeverity(),
677 QObject::tr("%1, a dependency of this component, has reported issues").arg(reqComp->getName()));
678 }
679 if (!req.equalsVersion.isEmpty() && req.equalsVersion != reqComp->getVersion()) {
680 component->addComponentProblem(ProblemSeverity::Error,
681 QObject::tr("%1, a dependency of this component, is not the required version %2")
682 .arg(reqComp->getName(), req.equalsVersion));
683 } else if (!req.suggests.isEmpty() && req.suggests != reqComp->getVersion()) {
684 component->addComponentProblem(ProblemSeverity::Warning,
685 QObject::tr("%1, a dependency of this component, is not the suggested version %2")
686 .arg(reqComp->getName(), req.suggests));
687 }
688 }
689 }
690 for (auto conflict : component->knownConflictingComponents()) {
691 auto found = componentIndex.find(conflict);
692 if (found != componentIndex.cend()) {
693 auto foundComp = *found;
694 if (foundComp->isCustom()) {
695 continue;
696 }
697 component->addComponentProblem(
698 ProblemSeverity::Warning,
699 QObject::tr("%1 and %2 are known to not work together. It is recommended to remove one of them.")
700 .arg(component->getName(), foundComp->getName()));
701 }
702 }
703 }
704}
705
706void ComponentUpdateTask::remoteLoadSucceeded(size_t taskIndex)
707{

Callers

nothing calls this directly

Calls 9

addComponentProblemMethod · 0.80
getNameMethod · 0.80
isCustomMethod · 0.80
findMethod · 0.45
isEmptyMethod · 0.45
getProblemsMethod · 0.45
getProblemSeverityMethod · 0.45
getVersionMethod · 0.45

Tested by

no test coverage detected