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

Method clearScans

core/problemcollector.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void ProblemCollector::clearScans()
81{
82 // Remove all elements which originate from a previous scan, before doing a new scan
83 // and do so, properly informing the model about all changes.
84 auto firstToDeleteIt = m_problems.begin();
85 auto it = firstToDeleteIt;
86 while (true) {
87 if (it != m_problems.end() && it->findingCategory == Problem::Scan) {
88 ++it;
89 } else if (firstToDeleteIt != it) { // this is supposed to be called also if `it == m_problems.end()`
90 auto firstRow = std::distance(m_problems.begin(), firstToDeleteIt);
91 auto count = std::distance(m_problems.begin(), it) - firstRow;
92 emit aboutToRemoveProblems(firstRow, count);
93 firstToDeleteIt = it = m_problems.erase(firstToDeleteIt, it);
94 emit problemsRemoved();
95 } else if (it != m_problems.end()) {
96 ++it;
97 ++firstToDeleteIt;
98 } else {
99 break;
100 }
101 }
102}
103
104const QVector<Problem> &ProblemCollector::problems()
105{

Callers 2

cleanupMethod · 0.80
testScansMethod · 0.80

Calls 2

endMethod · 0.80
beginMethod · 0.45

Tested by 2

cleanupMethod · 0.64
testScansMethod · 0.64