author | kergoth <kergoth> | 2003-02-18 18:28:18 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-02-18 18:28:18 (UTC) |
commit | 50f0a50a14f87960cf9492d01aeed5a56a6dca06 (patch) (unidiff) | |
tree | 4c922e0fbdc815aba671c09975e56d77140b2c30 | |
parent | f8226f95152e53948b064303b5dc6513ece222aa (diff) | |
download | opie-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.
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 10 |
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 | |||
@@ -38,12 +38,16 @@ | |||
38 | #include "instoptionsimpl.h" | 38 | #include "instoptionsimpl.h" |
39 | #include "installdlgimpl.h" | 39 | #include "installdlgimpl.h" |
40 | #include "ipkg.h" | 40 | #include "ipkg.h" |
41 | #include "utils.h" | 41 | #include "utils.h" |
42 | #include "global.h" | 42 | #include "global.h" |
43 | 43 | ||
44 | enum { | ||
45 | MAXLINES = 100, | ||
46 | }; | ||
47 | |||
44 | InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *dataManager, const char *title ) | 48 | InstallDlgImpl::InstallDlgImpl( QList<InstallData> &packageList, DataManager *dataManager, const char *title ) |
45 | : QWidget( 0, 0, 0 ) | 49 | : QWidget( 0, 0, 0 ) |
46 | { | 50 | { |
47 | setCaption( title ); | 51 | setCaption( title ); |
48 | init( TRUE ); | 52 | init( TRUE ); |
49 | 53 | ||
@@ -316,12 +320,18 @@ void InstallDlgImpl :: installSelected() | |||
316 | } | 320 | } |
317 | 321 | ||
318 | 322 | ||
319 | void InstallDlgImpl :: displayText(const QString &text ) | 323 | void InstallDlgImpl :: displayText(const QString &text ) |
320 | { | 324 | { |
321 | QString newtext = QString( "%1\n%2" ).arg( output->text() ).arg( text ); | 325 | QString newtext = QString( "%1\n%2" ).arg( output->text() ).arg( text ); |
326 | |||
327 | /* Set a max line count for the QMultiLineEdit, as users have reported | ||
328 | * performance issues when line count gets extreme. | ||
329 | */ | ||
330 | if(output->numLines() >= MAXLINES) | ||
331 | output->removeLine(0); | ||
322 | output->setText( newtext ); | 332 | output->setText( newtext ); |
323 | output->setCursorPosition( output->numLines(), 0 ); | 333 | output->setCursorPosition( output->numLines(), 0 ); |
324 | } | 334 | } |
325 | 335 | ||
326 | 336 | ||
327 | void InstallDlgImpl :: displayAvailableSpace( const QString &text ) | 337 | void InstallDlgImpl :: displayAvailableSpace( const QString &text ) |