| 13 | connect(this, &GitCloneJob::resultsReady, this, &GitCloneJob::processResult); |
| 14 | } |
| 15 | void GitCloneJob::processResult() |
| 16 | { |
| 17 | if (error()) { |
| 18 | QByteArray out = errorOutput(); |
| 19 | if (out.contains('\n')) { |
| 20 | m_steps+=out.count('\n'); |
| 21 | emitPercent(m_steps, 6); //I'm counting 6 lines so it's a way to provide some progress, probably not the best |
| 22 | } |
| 23 | |
| 24 | int end = qMax(out.lastIndexOf('\n'), out.lastIndexOf('\r')); |
| 25 | int start = qMax(qMax(out.lastIndexOf('\n', end-1), out.lastIndexOf('\r', end-1)), 0); |
| 26 | |
| 27 | const QString info = QString::fromUtf8(out.mid(start+1, end-start-1)); |
| 28 | emit infoMessage(this, info); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | #include "moc_gitclonejob.cpp" |