forked from qt-creator/qt-creator
OutputFormatter: Simplify logic
Change-Id: I092cdb351f7530284e915cd4955973b21f2577b5 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -204,12 +204,12 @@ void OutputFormatter::appendMessage(const QString &text, OutputFormat format)
|
||||
out.chop(1);
|
||||
}
|
||||
|
||||
if (format == ErrorMessageFormat || format == NormalMessageFormat) {
|
||||
if (format != StdOutFormatSameLine && format != StdErrFormatSameLine) {
|
||||
doAppendMessage(doNewlineEnforcement(out), format);
|
||||
} else {
|
||||
const bool sameLine = format == StdOutFormatSameLine || format == StdErrFormatSameLine;
|
||||
if (sameLine) {
|
||||
bool enforceNewline = d->enforceNewline;
|
||||
return;
|
||||
}
|
||||
|
||||
const bool enforceNewline = d->enforceNewline;
|
||||
d->enforceNewline = false;
|
||||
if (enforceNewline) {
|
||||
out.prepend('\n');
|
||||
@@ -231,10 +231,6 @@ void OutputFormatter::appendMessage(const QString &text, OutputFormat format)
|
||||
}
|
||||
doAppendMessage(out, format);
|
||||
}
|
||||
} else {
|
||||
doAppendMessage(doNewlineEnforcement(out), format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString OutputFormatter::doNewlineEnforcement(const QString &out)
|
||||
|
Reference in New Issue
Block a user