| 1620 | } |
| 1621 | |
| 1622 | void Diff3LineList::findHistoryRange(const QRegularExpression& historyStart, bool bThreeFiles, HistoryRange& range) const |
| 1623 | { |
| 1624 | QString historyLead; |
| 1625 | // Search for start of history |
| 1626 | for(range.start = begin(), range.startIdx = 0; range.start != end(); ++range.start, ++range.startIdx) |
| 1627 | { |
| 1628 | if(historyStart.match(range.start->getString(e_SrcSelector::A)).hasMatch() && |
| 1629 | historyStart.match(range.start->getString(e_SrcSelector::B)).hasMatch() && |
| 1630 | (!bThreeFiles || historyStart.match(range.start->getString(e_SrcSelector::C)).hasMatch())) |
| 1631 | { |
| 1632 | historyLead = Utils::calcHistoryLead(range.start->getString(e_SrcSelector::A)); |
| 1633 | break; |
| 1634 | } |
| 1635 | } |
| 1636 | // Search for end of history |
| 1637 | for(range.end = range.start, range.endIdx = range.startIdx; range.end != end(); ++range.end, ++range.endIdx) |
| 1638 | { |
| 1639 | const QString sA = range.end->getString(e_SrcSelector::A); |
| 1640 | const QString sB = range.end->getString(e_SrcSelector::B); |
| 1641 | const QString sC = range.end->getString(e_SrcSelector::C); |
| 1642 | if((!sA.isEmpty() && historyLead != Utils::calcHistoryLead(sA)) || |
| 1643 | (!sB.isEmpty() && historyLead != Utils::calcHistoryLead(sB)) || |
| 1644 | (bThreeFiles && !sC.isEmpty() && historyLead != Utils::calcHistoryLead(sC))) |
| 1645 | { |
| 1646 | break; // End of the history |
| 1647 | } |
| 1648 | } |
| 1649 | } |
| 1650 | |
| 1651 | void Diff3LineList::dump() |
| 1652 | { |
no test coverage detected