ProjectExplorer: Give the Task class an explicit summary

We'd like to create more useful tasks from compiler output, that is, try
harder to identify consecutive lines that refer to the same issue and
create one task for them, rather than one for each line. In such
"aggregate" tasks, the first line will not necessarily carry the main
information. Therefore, we make it explicit what this main information
is by introducing a dedicated summary member.
Also streamline the font handling for compile tasks.

Change-Id: I933f2643a13c710dab1ab548c56669b129026eb5
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-05-12 16:26:34 +02:00
parent e35f945758
commit b02f6b5d30
29 changed files with 89 additions and 157 deletions

View File

@@ -101,9 +101,9 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
m_lines = 1;
return {Status::InProgress, linkSpecs};
} else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull()) {
if (!m_lastTask.description.isEmpty())
m_lastTask.description.append(QLatin1Char(' '));
m_lastTask.description.append(trimmedLine.trimmed());
if (!m_lastTask.summary.isEmpty())
m_lastTask.summary.append(' ');
m_lastTask.summary.append(trimmedLine.trimmed());
++m_lines;
return Status::InProgress;
} else if (trimmedLine.endsWith(QLatin1String("in cmake code at"))) {
@@ -136,7 +136,7 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
return {Status::InProgress, linkSpecs};
}
case LINE_DESCRIPTION:
m_lastTask.description = trimmedLine;
m_lastTask.summary = trimmedLine;
if (trimmedLine.endsWith(QLatin1Char('\"')))
m_expectTripleLineErrorData = LINE_DESCRIPTION2;
else {
@@ -146,8 +146,7 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
}
return Status::InProgress;
case LINE_DESCRIPTION2:
m_lastTask.description.append(QLatin1Char('\n'));
m_lastTask.description.append(trimmedLine);
m_lastTask.details.append(trimmedLine);
m_expectTripleLineErrorData = NONE;
flush();
return Status::Done;