From 50f0a50a14f87960cf9492d01aeed5a56a6dca06 Mon Sep 17 00:00:00 2001 From: kergoth Date: Tue, 18 Feb 2003 18:28:18 +0000 Subject: Use a max line count on the QMultiLineEdit used for ipkg output, as users have reported performance issues when the line count gets huge. --- (limited to 'noncore/settings/aqpkg') diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index 9339086..1f0bb5f 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp @@ -41,6 +41,10 @@ #include "utils.h" #include "global.h" +enum { + MAXLINES = 100, +}; + InstallDlgImpl::InstallDlgImpl( QList &packageList, DataManager *dataManager, const char *title ) : QWidget( 0, 0, 0 ) { @@ -319,6 +323,12 @@ void InstallDlgImpl :: installSelected() void InstallDlgImpl :: displayText(const QString &text ) { QString newtext = QString( "%1\n%2" ).arg( output->text() ).arg( text ); + + /* Set a max line count for the QMultiLineEdit, as users have reported + * performance issues when line count gets extreme. + */ + if(output->numLines() >= MAXLINES) + output->removeLine(0); output->setText( newtext ); output->setCursorPosition( output->numLines(), 0 ); } -- cgit v0.9.0.2