Move some code from OutputWindow to OutputFormatter

That's where it belongs: The logic there is applicable to all output
formatters, not just those used via an output window.

Change-Id: Idf4ca8d22631ca96feb97553f28724c0275e0bf8
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-03-13 17:17:05 +01:00
parent f88789081d
commit 0ff5bf75e1
9 changed files with 98 additions and 95 deletions

View File

@@ -228,10 +228,7 @@ void OutputWindowPlainTextEdit::appendLines(const QString &s, const QString &rep
const int previousLineCount = document()->lineCount();
const QChar newLine('\n');
const QChar lastChar = s.at(s.size() - 1);
const bool appendNewline = (lastChar != '\r' && lastChar != newLine);
m_formatter->appendMessage(appendNewline ? s + newLine : s, m_format);
m_formatter->appendMessage(s, m_format);
// Scroll down
moveCursor(QTextCursor::End);