MCPcopy Create free account
hub / github.com/KDE/kdevelop / addProblem

Method addProblem

kdevplatform/shell/filteredproblemstore.cpp:114–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

addDiagnosticsFunction · 0.85
strMethod · 0.80
addChildMethod · 0.80
finalLocationMethod · 0.45
childrenMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
diagnosticsMethod · 0.45

Tested by

no test coverage detected