From 77f1409a838ec6d7c7be0a0846ba991373b4d0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 1 Jan 2019 17:01:23 +0100 Subject: [PATCH] triage: better handling of donate-cpu results --- tools/triage/mainwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/triage/mainwindow.cpp b/tools/triage/mainwindow.cpp index 1ec21f749..6ded61442 100644 --- a/tools/triage/mainwindow.cpp +++ b/tools/triage/mainwindow.cpp @@ -38,15 +38,17 @@ void MainWindow::loadFile() QString errorMessage; QStringList allErrors; while (true) { - const QString line = textStream.readLine(); + QString line = textStream.readLine(); if (line.isNull()) break; if (line.startsWith("ftp://")) { - if (!url.isEmpty() && !errorMessage.isEmpty()) - allErrors << (url + "\n" + errorMessage); url = line; + if (!errorMessage.isEmpty()) + allErrors << errorMessage; errorMessage.clear(); } 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) errorMessage += '\n' + line; else if (errorMessage.isEmpty()) { @@ -55,8 +57,6 @@ void MainWindow::loadFile() 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 (!errorMessage.isEmpty())