The code is adapted version of cppcheck::ProblemModel::addProblems() TODO Add into KDevelop::ProblemModel class ?
| 57 | // The code is adapted version of cppcheck::ProblemModel::addProblems() |
| 58 | // TODO Add into KDevelop::ProblemModel class ? |
| 59 | void CompileAnalyzeProblemModel::addProblems(const QVector<KDevelop::IProblem::Ptr>& problems) |
| 60 | { |
| 61 | if (m_problems.isEmpty()) { |
| 62 | m_maxProblemDescriptionLength = 0; |
| 63 | } |
| 64 | |
| 65 | for (const auto& problem : problems) { |
| 66 | if (problemExists(problem)) { |
| 67 | continue; |
| 68 | } |
| 69 | |
| 70 | m_problems.append(problem); |
| 71 | addProblem(problem); |
| 72 | |
| 73 | // This performs adjusting of columns width in the ProblemsView |
| 74 | if (m_maxProblemDescriptionLength < problem->description().length()) { |
| 75 | m_maxProblemDescriptionLength = problem->description().length(); |
| 76 | setProblems(m_problems); |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | void CompileAnalyzeProblemModel::finishAddProblems(bool jobSucceeded) |
| 82 | { |
nothing calls this directly
no test coverage detected