diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-07-10 13:20:23 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-07-10 14:40:18 +0200 |
commit | b859b06fe06cbe1ac9edaef0577d5aea3717483e (patch) | |
tree | bbfb8eeb8d610b14c7299af0b470076ae56ac2ff | |
parent | 88b5356d5f6052f49b3113f1c65353548ec935af (diff) |
Cleanup, not functional change intended.
Change-Id: Icc23e0fa5059be7b41c58d8b49c957d6702d8fc1
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r-- | src/libs/installer/lazyplaintextedit.cpp | 24 | ||||
-rw-r--r-- | src/libs/installer/lazyplaintextedit.h | 4 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/libs/installer/lazyplaintextedit.cpp b/src/libs/installer/lazyplaintextedit.cpp index 71f7b84eb..c0857458a 100644 --- a/src/libs/installer/lazyplaintextedit.cpp +++ b/src/libs/installer/lazyplaintextedit.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2012-2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2012-2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Installer Framework. @@ -45,8 +45,9 @@ const int INTERVAL = 20; -LazyPlainTextEdit::LazyPlainTextEdit(QWidget *parent) : - QPlainTextEdit(parent), m_timerId(0) +LazyPlainTextEdit::LazyPlainTextEdit(QWidget *parent) + : QPlainTextEdit(parent) + , m_timerId(0) { } @@ -55,17 +56,17 @@ void LazyPlainTextEdit::timerEvent(QTimerEvent *event) if (event->timerId() == m_timerId) { killTimer(m_timerId); m_timerId = 0; - m_chachedOutput.chop(1); //removes the last \n - if (!m_chachedOutput.isEmpty()) - appendPlainText(m_chachedOutput); + m_cachedOutput.chop(1); //removes the last \n + if (!m_cachedOutput.isEmpty()) + appendPlainText(m_cachedOutput); horizontalScrollBar()->setValue( 0 ); - m_chachedOutput.clear(); + m_cachedOutput.clear(); } } void LazyPlainTextEdit::append(const QString &text) { - m_chachedOutput.append(text + QLatin1String("\n")); + m_cachedOutput.append(text + QLatin1String("\n")); if (isVisible() && m_timerId == 0) m_timerId = startTimer(INTERVAL); } @@ -75,7 +76,7 @@ void LazyPlainTextEdit::clear() if (m_timerId) { killTimer(m_timerId); m_timerId = 0; - m_chachedOutput.clear(); + m_cachedOutput.clear(); } QPlainTextEdit::clear(); } @@ -87,8 +88,9 @@ void LazyPlainTextEdit::setVisible(bool visible) killTimer(m_timerId); m_timerId = 0; } - if (visible) { + + if (visible) m_timerId = startTimer(INTERVAL); - } + QPlainTextEdit::setVisible(visible); } diff --git a/src/libs/installer/lazyplaintextedit.h b/src/libs/installer/lazyplaintextedit.h index 648a0fba1..34651a36b 100644 --- a/src/libs/installer/lazyplaintextedit.h +++ b/src/libs/installer/lazyplaintextedit.h @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2012-2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2012-2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Installer Framework. @@ -57,8 +57,8 @@ public slots: protected: void timerEvent(QTimerEvent *event); private: - QString m_chachedOutput; int m_timerId; + QString m_cachedOutput; }; #endif // LAZYPLAINTEXTEDIT_H |