Fix a clazy warning [clazy-auto-unexpected-qstringbuilder]

Fix the following clazy warning:
lambda return type deduced to be QStringBuilder instead of QString.
Possible crash. [clazy-auto-unexpected-qstringbuilder]
We fix it by defining explicitly the return type of lambda.

Change-Id: I50e4a52c7039d736c8db9274e21a0c4eb63df5bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-17 10:11:20 +01:00
parent df9d1414b8
commit 3b571a2c70

View File

@@ -290,7 +290,8 @@ void OutputFormatter::doAppendMessage(const QString &text, OutputFormat format)
QList<FormattedText> formattedText = parseAnsi(text, charFmt); QList<FormattedText> formattedText = parseAnsi(text, charFmt);
const QString cleanLine = std::accumulate(formattedText.begin(), formattedText.end(), QString(), const QString cleanLine = std::accumulate(formattedText.begin(), formattedText.end(), QString(),
[](const FormattedText &t1, const FormattedText &t2) { return t1.text + t2.text; }); [](const FormattedText &t1, const FormattedText &t2) -> QString
{ return t1.text + t2.text; });
QList<OutputLineParser *> involvedParsers; QList<OutputLineParser *> involvedParsers;
const OutputLineParser::Result res = handleMessage(cleanLine, format, involvedParsers); const OutputLineParser::Result res = handleMessage(cleanLine, format, involvedParsers);