From 03b75b54ca37d2605fe749f67f1454b6448a0ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 15 Aug 2017 22:09:55 +0200 Subject: [PATCH] GUI: Updated parsing of addon output --- gui/checkthread.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index cecb4339c..c2f545546 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -313,24 +313,18 @@ void CheckThread::parseAddonErrors(QString err, QString tool) QTextStream in(&err, QIODevice::ReadOnly); while (!in.atEnd()) { QString line = in.readLine(); - QRegExp r1("\\[([^:]+):([0-9]+)\\](.*)"); + QRegExp r1("\\[([a-zA-Z]?:?[^:]+):([0-9]+)\\][ ][(]([a-z]+)[)]: (.+) \\[([a-zA-Z0-9_\\-\\.]+)\\]"); if (!r1.exactMatch(line)) continue; const std::string &filename = r1.cap(1).toStdString(); const int lineNumber = r1.cap(2).toInt(); + const std::string severity = r1.cap(3).toStdString(); + const std::string message = r1.cap(4).toStdString(); + const std::string id = r1.cap(5).toStdString(); - std::string message, id; - QRegExp r2("(.*)\\[([a-zA-Z0-9\\-\\._]+)\\]"); - if (r2.exactMatch(r1.cap(3))) { - message = r2.cap(1).toStdString(); - id = tool.toStdString() + '-' + r2.cap(2).toStdString(); - } else { - message = r1.cap(3).toStdString(); - id = tool.toStdString(); - } std::list callstack; callstack.push_back(ErrorLogger::ErrorMessage::FileLocation(filename, lineNumber)); - ErrorLogger::ErrorMessage errmsg(callstack, filename, Severity::style, message, id, false); + ErrorLogger::ErrorMessage errmsg(callstack, filename, Severity::fromString(severity), message, id, false); mResult.reportErr(errmsg); } }