forked from qt-creator/qt-creator
debugger: speed up logging by collecting bigger chunks
Change-Id: Ie2171e0afdc0e3296f57974b1e4e5ee952658626 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user