aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/logwindow.cpp
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2012-06-28 08:15:50 +0200
committerhjk <qthjk@ovi.com>2012-06-28 08:16:59 +0200
commit68ce7a667bf8e7182d154cd3aecdf24ff474ce8d (patch)
treec21610ef9f2b8b474da0587120c321e6582f09b6 /src/plugins/debugger/logwindow.cpp
parent27fbe170d43e4c471fc1ca1d59dc478a10ca5404 (diff)
debugger: speed up logging by collecting bigger chunks
Change-Id: Ie2171e0afdc0e3296f57974b1e4e5ee952658626 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/logwindow.cpp')
-rw-r--r--src/plugins/debugger/logwindow.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp
index 74dd0d5473..4329b507c0 100644
--- a/src/plugins/debugger/logwindow.cpp
+++ b/src/plugins/debugger/logwindow.cpp
@@ -394,6 +394,8 @@ LogWindow::LogWindow(QWidget *parent)
connect(m_inputText, SIGNAL(executeLineRequested()),
SLOT(executeLine()));
+ connect(&m_outputTimer, SIGNAL(timeout()), SLOT(doOutput()));
+
setMinimumHeight(60);
}
@@ -414,9 +416,6 @@ void LogWindow::showOutput(int channel, const QString &output)
if (output.isEmpty())
return;
- QTextCursor cursor = m_combinedText->textCursor();
- const bool atEnd = cursor.atEnd();
-
const QChar cchar = charForChannel(channel);
const QChar nchar = QLatin1Char('\n');
@@ -445,7 +444,24 @@ void LogWindow::showOutput(int channel, const QString &output)
}
pos = nnpos + 1;
}
- m_combinedText->append(out);
+ if (!out.endsWith(nchar))
+ out.append(nchar);
+
+ m_queuedOutput.append(out);
+ m_outputTimer.setSingleShot(true);
+ m_outputTimer.start(80);
+}
+
+void LogWindow::doOutput()
+{
+ if (m_queuedOutput.isEmpty())
+ return;
+
+ QTextCursor cursor = m_combinedText->textCursor();
+ const bool atEnd = cursor.atEnd();
+
+ m_combinedText->append(m_queuedOutput);
+ m_queuedOutput.clear();
if (atEnd) {
cursor.movePosition(QTextCursor::End);