| 693 | } |
| 694 | |
| 695 | void 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 | |
| 741 | void ComponentUpdateTask::remoteLoadSucceeded(size_t taskIndex) |
| 742 | { |
nothing calls this directly
no test coverage detected