From 1758f55f1cfd21bcf155194b358a7e82833ce203 Mon Sep 17 00:00:00 2001 From: cranphin Date: Thu, 23 Sep 2010 22:19:40 +0000 Subject: [PATCH] GCS GPS Display: Noticed redrawing got real slow if I left the GPS Display running for a while. I'm blaming that on the text area filling with a million lines, though that still needs to be confirmed. So I added a arbritrary 200 line limit, after which lines at the top start disapearing. Seems sensible anyways :) git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1730 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp index d7b4f6c9b..b142b9ee8 100644 --- a/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp +++ b/ground/src/plugins/gpsdisplay/gpsdisplaywidget.cpp @@ -96,6 +96,13 @@ void GpsDisplayWidget::setFixType(const QString &fixtype) void GpsDisplayWidget::dumpPacket(const QString &packet) { textBrowser->append(packet); + if(textBrowser->document()->lineCount() > 200) { + QTextCursor tc = textBrowser->textCursor(); + tc.movePosition(QTextCursor::Start); + tc.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor); + tc.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); + tc.removeSelectedText(); + } } void GpsDisplayWidget::setSVs(int sv)