triage: better handling of donate-cpu results

This commit is contained in:
Daniel Marjamäki 2019-01-01 17:01:23 +01:00
parent 2cdb55da56
commit 77f1409a83
1 changed files with 5 additions and 5 deletions

View File

@ -38,15 +38,17 @@ void MainWindow::loadFile()
QString errorMessage; QString errorMessage;
QStringList allErrors; QStringList allErrors;
while (true) { while (true) {
const QString line = textStream.readLine(); QString line = textStream.readLine();
if (line.isNull()) if (line.isNull())
break; break;
if (line.startsWith("ftp://")) { if (line.startsWith("ftp://")) {
if (!url.isEmpty() && !errorMessage.isEmpty())
allErrors << (url + "\n" + errorMessage);
url = line; url = line;
if (!errorMessage.isEmpty())
allErrors << errorMessage;
errorMessage.clear(); errorMessage.clear();
} else if (!url.isEmpty() && QRegExp(".*: (error|warning|style|note):.*").exactMatch(line)) { } else if (!url.isEmpty() && QRegExp(".*: (error|warning|style|note):.*").exactMatch(line)) {
if (QRegExp("^(head|1.[0-9][0-9]) .*").exactMatch(line))
line = line.mid(5);
if (line.indexOf(": note:") > 0) if (line.indexOf(": note:") > 0)
errorMessage += '\n' + line; errorMessage += '\n' + line;
else if (errorMessage.isEmpty()) { else if (errorMessage.isEmpty()) {
@ -55,8 +57,6 @@ void MainWindow::loadFile()
allErrors << errorMessage; allErrors << errorMessage;
errorMessage = url + '\n' + line; errorMessage = url + '\n' + line;
} }
} else if (!url.isEmpty() && QRegExp("^(head|1.[0-9][0-9]) .*:[0-9]+:.*\\]").exactMatch(line)) {
allErrors << (url + '\n' + line);
} }
} }
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())