MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / finalizeComponents

Method finalizeComponents

launcher/minecraft/ComponentUpdateTask.cpp:695–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695void ComponentUpdateTask::finalizeComponents()
696{
697 auto& components = d->m_profile->d->components;
698 auto& componentIndex = d->m_profile->d->componentIndex;
699 for (auto component : components) {
700 for (auto req : component->m_cachedRequires) {
701 auto found = componentIndex.find(req.uid);
702 if (found == componentIndex.cend()) {
703 component->addComponentProblem(
704 ProblemSeverity::Error,
705 QObject::tr("%1 is missing requirement %2 %3")
706 .arg(component->getName(), req.uid, req.equalsVersion.isEmpty() ? req.suggests : req.equalsVersion));
707 } else {
708 auto reqComp = *found;
709 if (!reqComp->getProblems().isEmpty()) {
710 component->addComponentProblem(
711 reqComp->getProblemSeverity(),
712 QObject::tr("%1, a dependency of this component, has reported issues").arg(reqComp->getName()));
713 }
714 if (!req.equalsVersion.isEmpty() && req.equalsVersion != reqComp->getVersion()) {
715 component->addComponentProblem(ProblemSeverity::Error,
716 QObject::tr("%1, a dependency of this component, is not the required version %2")
717 .arg(reqComp->getName(), req.equalsVersion));
718 } else if (!req.suggests.isEmpty() && req.suggests != reqComp->getVersion()) {
719 component->addComponentProblem(ProblemSeverity::Warning,
720 QObject::tr("%1, a dependency of this component, is not the suggested version %2")
721 .arg(reqComp->getName(), req.suggests));
722 }
723 }
724 }
725 for (auto conflict : component->knownConflictingComponents()) {
726 auto found = componentIndex.find(conflict);
727 if (found != componentIndex.cend()) {
728 auto foundComp = *found;
729 if (foundComp->isCustom()) {
730 continue;
731 }
732 component->addComponentProblem(
733 ProblemSeverity::Warning,
734 QObject::tr("%1 and %2 are known to not work together. It is recommended to remove one of them.")
735 .arg(component->getName(), foundComp->getName()));
736 }
737 }
738 }
739}
740
741void ComponentUpdateTask::remoteLoadSucceeded(size_t taskIndex)
742{

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