aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmakeprojectmanager/qmakeparser.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2020-04-08 17:45:39 +0200
committerChristian Kandeler <[email protected]>2020-04-09 14:49:32 +0000
commit45ba9fcd535e4cfd5f057149b1ca4bb4dfed5bdb (patch)
tree3e3246ccf3d971e69004182007bd1b726b88b8bf /src/plugins/qmakeprojectmanager/qmakeparser.cpp
parentfa517bd72aa21ea82072af27ce98030c4ff028f2 (diff)
Output parsers: Replace the chaining approach
Use "flat" aggregation instead. This is another step towards the formatter/parser merger. Along the way, also fix some some subclasses (mostly in BareMetal) that erroneously forwarded handled output to other parsers. Task-number: QTCREATORBUG-22665 Change-Id: I12947349ca663d2e6bbfc99efd069d69e2b54969 Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakeparser.cpp')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparser.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp
index 3952e591ec9..86a0ffc67b3 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp
@@ -40,12 +40,10 @@ QMakeParser::QMakeParser() : m_error(QLatin1String("^(.+):(\\d+):\\s(.+)$"))
m_error.setMinimal(true);
}
-void QMakeParser::handleLine(const QString &line, OutputFormat type)
+IOutputParser::Status QMakeParser::doHandleLine(const QString &line, OutputFormat type)
{
- if (type != Utils::StdErrFormat) {
- IOutputParser::handleLine(line, type);
- return;
- }
+ if (type != Utils::StdErrFormat)
+ return Status::NotHandled;
QString lne = rightTrimmed(line);
if (m_error.indexIn(lne) > -1) {
QString fileName = m_error.cap(1);
@@ -68,21 +66,21 @@ void QMakeParser::handleLine(const QString &line, OutputFormat type)
absoluteFilePath(FilePath::fromUserInput(fileName)),
m_error.cap(2).toInt() /* line */),
1);
- return;
+ return Status::Done;
}
if (lne.startsWith(QLatin1String("Project ERROR: "))
|| lne.startsWith(QLatin1String("ERROR: "))) {
const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2);
emit addTask(BuildSystemTask(Task::Error, description), 1);
- return;
+ return Status::Done;
}
if (lne.startsWith(QLatin1String("Project WARNING: "))
|| lne.startsWith(QLatin1String("WARNING: "))) {
const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2);
emit addTask(BuildSystemTask(Task::Warning, description), 1);
- return;
+ return Status::Done;
}
- IOutputParser::handleLine(line, StdErrFormat);
+ return Status::NotHandled;
}
} // QmakeProjectManager
@@ -183,7 +181,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data()
void QmakeProjectManagerPlugin::testQmakeOutputParsers()
{
OutputParserTester testbench;
- testbench.appendOutputParser(new QMakeParser);
+ testbench.addLineParser(new QMakeParser);
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);