forked from qt-creator/qt-creator
OutputWindow: Reduce scope of local variable
Found by cppcheck. Change-Id: I597021ddb3317cf6320bf25eb2d52141fa1e4f80 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
4960b2ac2a
commit
30359f725e
@@ -439,14 +439,13 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
|
|||||||
if (sameLine) {
|
if (sameLine) {
|
||||||
d->scrollToBottom = true;
|
d->scrollToBottom = true;
|
||||||
|
|
||||||
int newline = -1;
|
|
||||||
bool enforceNewline = d->enforceNewline;
|
bool enforceNewline = d->enforceNewline;
|
||||||
d->enforceNewline = false;
|
d->enforceNewline = false;
|
||||||
|
|
||||||
if (enforceNewline) {
|
if (enforceNewline) {
|
||||||
out.prepend('\n');
|
out.prepend('\n');
|
||||||
} else {
|
} else {
|
||||||
newline = out.indexOf(QLatin1Char('\n'));
|
const int newline = out.indexOf(QLatin1Char('\n'));
|
||||||
moveCursor(QTextCursor::End);
|
moveCursor(QTextCursor::End);
|
||||||
if (newline != -1) {
|
if (newline != -1) {
|
||||||
if (d->formatter)
|
if (d->formatter)
|
||||||
|
Reference in New Issue
Block a user