summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-02-18 18:28:18 (UTC)
committer kergoth <kergoth>2003-02-18 18:28:18 (UTC)
commit50f0a50a14f87960cf9492d01aeed5a56a6dca06 (patch) (side-by-side diff)
tree4c922e0fbdc815aba671c09975e56d77140b2c30
parentf8226f95152e53948b064303b5dc6513ece222aa (diff)
downloadopie-50f0a50a14f87960cf9492d01aeed5a56a6dca06.zip
opie-50f0a50a14f87960cf9492d01aeed5a56a6dca06.tar.gz
opie-50f0a50a14f87960cf9492d01aeed5a56a6dca06.tar.bz2
Use a max line count on the QMultiLineEdit used for ipkg output, as users have reported performance issues when the line count gets huge.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp10
1 files changed, 10 insertions, 0 deletions
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
@@ -36,16 +36,20 @@
#include "datamgr.h"
#include "destination.h"
#include "instoptionsimpl.h"
#include "installdlgimpl.h"
#include "ipkg.h"
#include "utils.h"
#include "global.h"
+enum {
+ MAXLINES = 100,
+};
+
InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *dataManager, const char *title )
: QWidget( 0, 0, 0 )
{
setCaption( title );
init( TRUE );
pIpkg = 0;
upgradePackages = false;
@@ -314,16 +318,22 @@ void InstallDlgImpl :: installSelected()
if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
displayAvailableSpace( destination->currentText() );
}
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 );
}
void InstallDlgImpl :: displayAvailableSpace( const QString &text )
{
Destination *d = dataMgr->getDestination( text );