| 64 | } |
| 65 | |
| 66 | void BzrAnnotateJob::parseNextLine() |
| 67 | { |
| 68 | for(;;) |
| 69 | { |
| 70 | Q_ASSERT(m_currentLine<=m_outputLines.size()); |
| 71 | if (m_currentLine == m_outputLines.size()) { |
| 72 | m_status = KDevelop::VcsJob::JobSucceeded; |
| 73 | emitResult(); |
| 74 | emit resultsReady(this); |
| 75 | break; |
| 76 | } |
| 77 | const QStringView currentLine = m_outputLines.at(m_currentLine); |
| 78 | if (currentLine.isEmpty()) { |
| 79 | ++m_currentLine; |
| 80 | continue; |
| 81 | } |
| 82 | bool revOk; |
| 83 | const auto revision = leftOfNeedleOrEntireView(currentLine, QLatin1Char{' '}).toULong(&revOk); |
| 84 | if (!revOk) { |
| 85 | // Future compatibility - not a revision yet |
| 86 | ++m_currentLine; |
| 87 | continue; |
| 88 | } |
| 89 | auto i = m_commits.find(revision); |
| 90 | if (i != m_commits.end()) { |
| 91 | KDevelop::VcsAnnotationLine line; |
| 92 | line.setAuthor(i.value().author()); |
| 93 | line.setCommitMessage(i.value().message()); |
| 94 | line.setDate(i.value().date()); |
| 95 | line.setLineNumber(m_currentLine); |
| 96 | line.setRevision(i.value().revision()); |
| 97 | m_results.append(QVariant::fromValue(line)); |
| 98 | ++m_currentLine; |
| 99 | continue; |
| 100 | } else { |
| 101 | prepareCommitInfo(revision); |
| 102 | break; //Will reenter this function when commit info will be ready |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void BzrAnnotateJob::prepareCommitInfo(std::size_t revision) |
| 108 | { |
nothing calls this directly
no test coverage detected