| 112 | } |
| 113 | |
| 114 | void addProblem(const IProblem::Ptr &problem) override |
| 115 | { |
| 116 | QString path = problem->finalLocation().document.str(); |
| 117 | |
| 118 | /// See if we already have this path |
| 119 | const auto childrenNodes = m_groupedRootNode->children(); |
| 120 | auto it = std::find_if(childrenNodes.begin(), childrenNodes.end(), [&](ProblemStoreNode* node) { |
| 121 | return (node->label() == path); |
| 122 | }); |
| 123 | ProblemStoreNode* parent = (it != childrenNodes.end()) ? *it : nullptr; |
| 124 | |
| 125 | /// If not add it! |
| 126 | if (parent == nullptr) { |
| 127 | parent = new LabelNode(m_groupedRootNode.data(), path); |
| 128 | m_groupedRootNode->addChild(parent); |
| 129 | } |
| 130 | |
| 131 | auto *node = new ProblemNode(parent, problem); |
| 132 | addDiagnostics(node, problem->diagnostics()); |
| 133 | parent->addChild(node); |
| 134 | } |
| 135 | |
| 136 | }; |
| 137 |
nothing calls this directly
no test coverage detected