triage: improve handling of daca@home results

This commit is contained in:
Daniel Marjamäki 2018-11-24 21:36:59 +01:00
parent b5e83d03fe
commit d2bd536f1b
1 changed files with 11 additions and 6 deletions

View File

@ -47,15 +47,20 @@ void MainWindow::loadFile()
url = line;
errorMessage.clear();
} else if (!url.isEmpty() && QRegExp(".*: (error|warning|style|note):.*").exactMatch(line)) {
if (!errorMessage.isEmpty())
errorMessage += '\n';
errorMessage += line;
} else if (!url.isEmpty() && QRegExp("(head|1.8.) .*:[0-9]+:.*\\]").exactMatch(line)) {
if (line.indexOf(": note:") > 0)
errorMessage += '\n' + line;
else if (errorMessage.isEmpty()) {
errorMessage = url + '\n' + line;
} else {
allErrors << errorMessage;
errorMessage = url + '\n' + line;
}
} else if (!url.isEmpty() && QRegExp("^(head|1.[0-9][0-9]) .*:[0-9]+:.*\\]").exactMatch(line)) {
allErrors << (url + '\n' + line);
}
}
if (!url.isEmpty() && !errorMessage.isEmpty())
allErrors << (url + "\n" + errorMessage);
if (!errorMessage.isEmpty())
allErrors << errorMessage;
if (allErrors.size() > 100) {
// remove items in /test/
for (int i = allErrors.size()-1; i >= 0 && allErrors.size() > 100; --i) {