summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp55
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
@@ -124,5 +124,6 @@ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name
124 intFields( order ), 124 intFields( order ),
125 enablePainting( true ), 125 enablePainting( true ),
126 columnVisible( true ) 126 columnVisible( true ),
127 countNested( 0 )
127{ 128{
128 qWarning("C'tor start"); 129 qWarning("C'tor start");
@@ -163,5 +164,5 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
163 164
164 setSorting( false ); 165 setSorting( false );
165 setUpdatesEnabled( FALSE ); 166 setPaintingEnabled( FALSE );
166 167
167 OContactAccess::List::Iterator it; 168 OContactAccess::List::Iterator it;
@@ -171,6 +172,4 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
171 insertIntoTable( *it, row++ ); 172 insertIntoTable( *it, row++ );
172 173
173 setUpdatesEnabled( TRUE );
174
175 setSorting( true ); 174 setSorting( true );
176 175
@@ -179,4 +178,6 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
179 updateVisible(); 178 updateVisible();
180 179
180 setPaintingEnabled( TRUE );
181
181} 182}
182 183
@@ -189,4 +190,5 @@ bool AbTable::selectContact( int UID )
189 bool found = false; 190 bool found = false;
190 191
192 setPaintingEnabled( FALSE );
191 for ( int r = 0; r < rows; ++r ) { 193 for ( int r = 0; r < rows; ++r ) {
192 abi = static_cast<AbTableItem*>( item(r, 0) ); 194 abi = static_cast<AbTableItem*>( item(r, 0) );
@@ -205,4 +207,6 @@ bool AbTable::selectContact( int UID )
205 } 207 }
206 208
209 setPaintingEnabled( TRUE );
210
207 return true; 211 return true;
208} 212}
@@ -210,5 +214,5 @@ bool AbTable::selectContact( int UID )
210void AbTable::insertIntoTable( const OContact& cnt, int row ) 214void AbTable::insertIntoTable( const OContact& cnt, int row )
211{ 215{
212 // qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); 216 qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row );
213 QString strName, 217 QString strName,
214 strContact; 218 strContact;
@@ -252,4 +256,5 @@ void AbTable::resort()
252{ 256{
253 qWarning( "void AbTable::resort()" ); 257 qWarning( "void AbTable::resort()" );
258 setPaintingEnabled( FALSE );
254 if ( sorting() ) { 259 if ( sorting() ) {
255 if ( lastSortCol == -1 ) 260 if ( lastSortCol == -1 )
@@ -259,4 +264,5 @@ void AbTable::resort()
259 updateVisible(); 264 updateVisible();
260 } 265 }
266 setPaintingEnabled( TRUE );
261} 267}
262 268
@@ -283,4 +289,6 @@ void AbTable::clear()
283 qWarning( "void AbTable::clear()" ); 289 qWarning( "void AbTable::clear()" );
284 contactList.clear(); 290 contactList.clear();
291
292 setPaintingEnabled( FALSE );
285 for ( int r = 0; r < numRows(); ++r ) { 293 for ( int r = 0; r < numRows(); ++r ) {
286 for ( int c = 0; c < numCols(); ++c ) { 294 for ( int c = 0; c < numCols(); ++c ) {
@@ -291,4 +299,5 @@ void AbTable::clear()
291 } 299 }
292 setNumRows( 0 ); 300 setNumRows( 0 );
301 setPaintingEnabled( TRUE );
293} 302}
294 303
@@ -301,4 +310,5 @@ void AbTable::refresh()
301 AbTableItem *abi; 310 AbTableItem *abi;
302 311
312 setPaintingEnabled( FALSE );
303 for ( int r = 0; r < rows; ++r ) { 313 for ( int r = 0; r < rows; ++r ) {
304 abi = static_cast<AbTableItem*>( item(r, 0) ); 314 abi = static_cast<AbTableItem*>( item(r, 0) );
@@ -307,4 +317,5 @@ void AbTable::refresh()
307 } 317 }
308 resort(); 318 resort();
319 setPaintingEnabled( TRUE );
309} 320}
310 321
@@ -455,4 +466,6 @@ void AbTable::fitColumns()
455 // Fix to better value 466 // Fix to better value
456 // contentsWidth = 130; 467 // contentsWidth = 130;
468
469 setPaintingEnabled( FALSE );
457 470
458 if ( columnVisible == false ){ 471 if ( columnVisible == false ){
@@ -467,4 +480,6 @@ void AbTable::fitColumns()
467 if ( columnWidth(1) < contentsWidth ) 480 if ( columnWidth(1) < contentsWidth )
468 setColumnWidth( 1, contentsWidth ); 481 setColumnWidth( 1, contentsWidth );
482
483 setPaintingEnabled( TRUE );
469} 484}
470 485
@@ -534,4 +549,6 @@ QStringList AbTable::choiceSelection(int /*index*/) const
534void AbTable::updateVisible() 549void AbTable::updateVisible()
535{ 550{
551 qWarning("void AbTable::updateVisible()");
552
536 int visible, 553 int visible,
537 totalRows, 554 totalRows,
@@ -541,8 +558,8 @@ void AbTable::updateVisible()
541 visible = 0; 558 visible = 0;
542 559
543 realignTable();
544
545 setPaintingEnabled( FALSE ); 560 setPaintingEnabled( FALSE );
546 561
562 realignTable();
563
547 totalRows = numRows(); 564 totalRows = numRows();
548 for ( row = 0; row < totalRows; row++ ) { 565 for ( row = 0; row < totalRows; row++ ) {
@@ -570,15 +587,31 @@ void AbTable::updateVisible()
570void AbTable::setPaintingEnabled( bool e ) 587void AbTable::setPaintingEnabled( bool e )
571{ 588{
572 if ( e != enablePainting ) { 589 qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
573 if ( !enablePainting ) { 590
591 if ( e ) {
592 if ( countNested > 0 )
593 --countNested;
594 if ( ! countNested ){
595 setUpdatesEnabled( true );
574 enablePainting = true; 596 enablePainting = true;
575 rowHeightChanged( 0 ); 597 rowHeightChanged( 0 );
576 viewport()->update(); 598 viewport()->update();
577 } else {
578 enablePainting = false;
579 } 599 }
600 } else {
601 ++countNested;
602 enablePainting = false;
603 setUpdatesEnabled( false );
580 } 604 }
605 qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested );
581} 606}
582 607
608void AbTable::viewportPaintEvent( QPaintEvent* e ) {
609 qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting);
610 if ( enablePainting )
611 QTable::viewportPaintEvent( e );
612}
613
614
615
583void AbTable::rowHeightChanged( int row ) 616void AbTable::rowHeightChanged( int row )
584{ 617{