summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Side-by-side diff
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
intFields( order ),
enablePainting( true ),
- columnVisible( true )
+ columnVisible( true ),
+ countNested( 0 )
{
qWarning("C'tor start");
@@ -163,5 +164,5 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
setSorting( false );
- setUpdatesEnabled( FALSE );
+ setPaintingEnabled( FALSE );
OContactAccess::List::Iterator it;
@@ -171,6 +172,4 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
insertIntoTable( *it, row++ );
- setUpdatesEnabled( TRUE );
-
setSorting( true );
@@ -179,4 +178,6 @@ void AbTable::setContacts( const OContactAccess::List& viewList )
updateVisible();
+ setPaintingEnabled( TRUE );
+
}
@@ -189,4 +190,5 @@ bool AbTable::selectContact( int UID )
bool found = false;
+ setPaintingEnabled( FALSE );
for ( int r = 0; r < rows; ++r ) {
abi = static_cast<AbTableItem*>( item(r, 0) );
@@ -205,4 +207,6 @@ bool AbTable::selectContact( int UID )
}
+ setPaintingEnabled( TRUE );
+
return true;
}
@@ -210,5 +214,5 @@ bool AbTable::selectContact( int UID )
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,
strContact;
@@ -252,4 +256,5 @@ void AbTable::resort()
{
qWarning( "void AbTable::resort()" );
+ setPaintingEnabled( FALSE );
if ( sorting() ) {
if ( lastSortCol == -1 )
@@ -259,4 +264,5 @@ void AbTable::resort()
updateVisible();
}
+ setPaintingEnabled( TRUE );
}
@@ -283,4 +289,6 @@ void AbTable::clear()
qWarning( "void AbTable::clear()" );
contactList.clear();
+
+ setPaintingEnabled( FALSE );
for ( int r = 0; r < numRows(); ++r ) {
for ( int c = 0; c < numCols(); ++c ) {
@@ -291,4 +299,5 @@ void AbTable::clear()
}
setNumRows( 0 );
+ setPaintingEnabled( TRUE );
}
@@ -301,4 +310,5 @@ void AbTable::refresh()
AbTableItem *abi;
+ setPaintingEnabled( FALSE );
for ( int r = 0; r < rows; ++r ) {
abi = static_cast<AbTableItem*>( item(r, 0) );
@@ -307,4 +317,5 @@ void AbTable::refresh()
}
resort();
+ setPaintingEnabled( TRUE );
}
@@ -455,4 +466,6 @@ void AbTable::fitColumns()
// Fix to better value
// contentsWidth = 130;
+
+ setPaintingEnabled( FALSE );
if ( columnVisible == false ){
@@ -467,4 +480,6 @@ void AbTable::fitColumns()
if ( columnWidth(1) < contentsWidth )
setColumnWidth( 1, contentsWidth );
+
+ setPaintingEnabled( TRUE );
}
@@ -534,4 +549,6 @@ QStringList AbTable::choiceSelection(int /*index*/) const
void AbTable::updateVisible()
{
+ qWarning("void AbTable::updateVisible()");
+
int visible,
totalRows,
@@ -541,8 +558,8 @@ void AbTable::updateVisible()
visible = 0;
- realignTable();
-
setPaintingEnabled( FALSE );
+ realignTable();
+
totalRows = numRows();
for ( row = 0; row < totalRows; row++ ) {
@@ -570,15 +587,31 @@ void AbTable::updateVisible()
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;
rowHeightChanged( 0 );
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 )
{