| 681 | } |
| 682 | |
| 683 | QString GitDiffWorker::readLine(const QString &text, QString *remainingText, bool *hasNewLine) |
| 684 | { |
| 685 | const QChar newLine('\n'); |
| 686 | const int indexOfFirstNewLine = text.indexOf(newLine); |
| 687 | if (indexOfFirstNewLine < 0) { |
| 688 | if (remainingText) |
| 689 | *remainingText = QString(); |
| 690 | if (hasNewLine) |
| 691 | *hasNewLine = false; |
| 692 | return text; |
| 693 | } |
| 694 | |
| 695 | if (hasNewLine) |
| 696 | *hasNewLine = true; |
| 697 | |
| 698 | if (remainingText) |
| 699 | *remainingText = text.mid(indexOfFirstNewLine + 1); |
| 700 | |
| 701 | return text.left(indexOfFirstNewLine); |
| 702 | } |
| 703 | |
| 704 | QList<RowData> GitDiffWorker::readLines(const QString &patch, bool lastChunk, bool *lastChunkAtTheEndOfFile, bool *ok) |
| 705 | { |
no test coverage detected