OutputWindow: Cleanup and modernize

Change-Id: Ie78c84e2677cabb144cfc678e5d1007fcae1f33a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-02-17 14:46:04 +01:00
committed by André Hartmann
parent 30359f725e
commit fff7e32877
2 changed files with 8 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ namespace Internal {
class OutputWindowPrivate
{
public:
OutputWindowPrivate(QTextDocument *document)
explicit OutputWindowPrivate(QTextDocument *document)
: cursor(document)
{
}
@@ -369,11 +369,11 @@ QString OutputWindow::doNewlineEnforcement(const QString &out)
d->scrollToBottom = true;
QString s = out;
if (d->enforceNewline) {
s.prepend(QLatin1Char('\n'));
s.prepend('\n');
d->enforceNewline = false;
}
if (s.endsWith(QLatin1Char('\n'))) {
if (s.endsWith('\n')) {
d->enforceNewline = true; // make appendOutputInline put in a newline next time
s.chop(1);
}
@@ -445,7 +445,7 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
if (enforceNewline) {
out.prepend('\n');
} else {
const int newline = out.indexOf(QLatin1Char('\n'));
const int newline = out.indexOf('\n');
moveCursor(QTextCursor::End);
if (newline != -1) {
if (d->formatter)
@@ -457,7 +457,7 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
if (out.isEmpty()) {
d->enforceNewline = true;
} else {
if (out.endsWith(QLatin1Char('\n'))) {
if (out.endsWith('\n')) {
d->enforceNewline = true;
out.chop(1);
}
@@ -500,7 +500,7 @@ void OutputWindow::appendText(const QString &textIn, const QTextCharFormat &form
tmp.setFontWeight(QFont::Bold);
d->cursor.insertText(doNewlineEnforcement(tr("Additional output omitted. You can increase "
"the limit in the \"Build & Run\" settings.")
+ QLatin1Char('\n')), tmp);
+ '\n'), tmp);
}
d->cursor.endEditBlock();

View File

@@ -109,7 +109,7 @@ private:
QString doNewlineEnforcement(const QString &out);
void filterNewContent();
Internal::OutputWindowPrivate *d;
Internal::OutputWindowPrivate *d = nullptr;
};
} // namespace Core