author | eilers <eilers> | 2002-11-27 15:21:06 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-11-27 15:21:06 (UTC) |
commit | 4b20972da142bbdea42c682025ab5303c35a5a92 (patch) (side-by-side diff) | |
tree | 934acaec747a495188a7d3c1e125ecc0776b68c6 /core/pim/addressbook/abtable.cpp | |
parent | 4d7272423782dc2f9f7dbde36b848f55eb323c79 (diff) | |
download | opie-4b20972da142bbdea42c682025ab5303c35a5a92.zip opie-4b20972da142bbdea42c682025ab5303c35a5a92.tar.gz opie-4b20972da142bbdea42c682025ab5303c35a5a92.tar.bz2 |
Extremely improved table update
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index e333b17..00335ae 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -125,3 +125,4 @@ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name enablePainting( true ), - columnVisible( true ) + columnVisible( true ), + countNested( 0 ) { @@ -164,3 +165,3 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) setSorting( false ); - setUpdatesEnabled( FALSE ); + setPaintingEnabled( FALSE ); @@ -172,4 +173,2 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) - setUpdatesEnabled( TRUE ); - setSorting( true ); @@ -180,2 +179,4 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) + setPaintingEnabled( TRUE ); + } @@ -190,2 +191,3 @@ bool AbTable::selectContact( int UID ) + setPaintingEnabled( FALSE ); for ( int r = 0; r < rows; ++r ) { @@ -206,2 +208,4 @@ bool AbTable::selectContact( int UID ) + setPaintingEnabled( TRUE ); + return true; @@ -211,3 +215,3 @@ void AbTable::insertIntoTable( const OContact& cnt, int row ) { - // qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); + qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); QString strName, @@ -253,2 +257,3 @@ void AbTable::resort() qWarning( "void AbTable::resort()" ); + setPaintingEnabled( FALSE ); if ( sorting() ) { @@ -260,2 +265,3 @@ void AbTable::resort() } + setPaintingEnabled( TRUE ); } @@ -284,2 +290,4 @@ void AbTable::clear() contactList.clear(); + + setPaintingEnabled( FALSE ); for ( int r = 0; r < numRows(); ++r ) { @@ -292,2 +300,3 @@ void AbTable::clear() setNumRows( 0 ); + setPaintingEnabled( TRUE ); } @@ -302,2 +311,3 @@ void AbTable::refresh() + setPaintingEnabled( FALSE ); for ( int r = 0; r < rows; ++r ) { @@ -308,2 +318,3 @@ void AbTable::refresh() resort(); + setPaintingEnabled( TRUE ); } @@ -456,2 +467,4 @@ void AbTable::fitColumns() // contentsWidth = 130; + + setPaintingEnabled( FALSE ); @@ -468,2 +481,4 @@ void AbTable::fitColumns() setColumnWidth( 1, contentsWidth ); + + setPaintingEnabled( TRUE ); } @@ -535,2 +550,4 @@ void AbTable::updateVisible() { + qWarning("void AbTable::updateVisible()"); + int visible, @@ -542,6 +559,6 @@ void AbTable::updateVisible() - realignTable(); - setPaintingEnabled( FALSE ); + realignTable(); + totalRows = numRows(); @@ -571,4 +588,9 @@ void AbTable::setPaintingEnabled( bool e ) { - if ( e != enablePainting ) { - if ( !enablePainting ) { + qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); + + if ( e ) { + if ( countNested > 0 ) + --countNested; + if ( ! countNested ){ + setUpdatesEnabled( true ); enablePainting = true; @@ -576,8 +598,19 @@ void AbTable::setPaintingEnabled( bool e ) viewport()->update(); - } else { - enablePainting = false; } + } else { + ++countNested; + enablePainting = false; + setUpdatesEnabled( false ); } + qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); } +void AbTable::viewportPaintEvent( QPaintEvent* e ) { + qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); + if ( enablePainting ) + QTable::viewportPaintEvent( e ); +} + + + void AbTable::rowHeightChanged( int row ) |