MCPcopy Create free account
hub / github.com/KDE/kdevelop / flushPending

Method flushPending

plugins/gdb/gdboutputwidget.cpp:293–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void GDBOutputWidget::flushPending()
294{
295 m_gdbView->setUpdatesEnabled(false);
296
297 // QTextEdit adds newline after paragraph automatically.
298 // So, remove trailing newline to avoid double newlines.
299 if (m_pendingOutput.endsWith(QLatin1Char('\n')))
300 m_pendingOutput.chop(1);
301 Q_ASSERT(!m_pendingOutput.endsWith(QLatin1Char('\n')));
302
303 QTextDocument *document = m_gdbView->document();
304 QTextCursor cursor(document);
305 cursor.movePosition(QTextCursor::End);
306 cursor.insertHtml(m_pendingOutput);
307 m_pendingOutput.clear();
308
309 m_gdbView->verticalScrollBar()->setValue(m_gdbView->verticalScrollBar()->maximum());
310 m_gdbView->setUpdatesEnabled(true);
311 m_gdbView->update();
312 if (m_cmdEditorHadFocus) {
313 m_userGDBCmdEditor->setFocus();
314 }
315}
316
317void GDBOutputWidget::debuggerStateChanged(DBGStateFlags newState)
318{

Callers

nothing calls this directly

Calls 5

endsWithMethod · 0.80
documentMethod · 0.45
clearMethod · 0.45
setValueMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected