OutputWindow: Reduce scope of local variable

Found by cppcheck.

Change-Id: I597021ddb3317cf6320bf25eb2d52141fa1e4f80
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-02-16 21:16:41 +01:00
committed by André Hartmann
parent 4960b2ac2a
commit 30359f725e

View File

@@ -439,14 +439,13 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
if (sameLine) {
d->scrollToBottom = true;
int newline = -1;
bool enforceNewline = d->enforceNewline;
d->enforceNewline = false;
if (enforceNewline) {
out.prepend('\n');
} else {
newline = out.indexOf(QLatin1Char('\n'));
const int newline = out.indexOf(QLatin1Char('\n'));
moveCursor(QTextCursor::End);
if (newline != -1) {
if (d->formatter)