MCPcopy Create free account
hub / github.com/KDAB/GammaRay / addProblem

Method addProblem

core/problemcollector.cpp:50–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void ProblemCollector::addProblem(const Problem &problem)
51{
52 auto self = instance();
53
54 auto i = std::find(self->m_problems.begin(), self->m_problems.end(), problem);
55 if (i != self->m_problems.end()) {
56 // if an already reported problem is reported a second time, but with a different source location,
57 // then the problem involves multiple source locations. So let's keep all of them.
58 std::remove_copy_if(problem.locations.begin(), problem.locations.end(), std::back_inserter(i->locations),
59 [&](const SourceLocation &loc) { return i->locations.contains(loc); });
60 return;
61 }
62
63 emit self->aboutToAddProblem(self->m_problems.size());
64 self->m_problems.push_back(problem);
65 emit self->problemAdded();
66}
67void ProblemCollector::removeProblem(const QString &problemId)
68{
69 auto self = instance();

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected