author | eilers <eilers> | 2003-01-31 13:51:13 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-01-31 13:51:13 (UTC) |
commit | 6f5a127080c50eb901ac6a332ac76d9948f91bd5 (patch) (unidiff) | |
tree | 8021e7597b9bc8e527b2fddac1e03dc0959434c9 /core/pim/addressbook/abtable.cpp | |
parent | 84bd32181af3922ccba35fcaed9b404d1e4deed8 (diff) | |
download | opie-6f5a127080c50eb901ac6a332ac76d9948f91bd5.zip opie-6f5a127080c50eb901ac6a332ac76d9948f91bd5.tar.gz opie-6f5a127080c50eb901ac6a332ac76d9948f91bd5.tar.bz2 |
Removed a lot of debug output.. Therefore it should speed up..
The settings of the combo-boxes in the contacteditor are now stored globally
and individual for a contact ( I fear this will not survive any synchronizing! ).
Thanks to tille for his assistance !
I hope there isn't any new bug in the contacteditor.. It is very ugly and hard
to debug..
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 00335ae..aec390d 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -123,22 +123,22 @@ AbTable::AbTable( const QValueList<int> order, QWidget *parent, const char *name | |||
123 | asc( TRUE ), | 123 | asc( TRUE ), |
124 | intFields( order ), | 124 | intFields( order ), |
125 | enablePainting( true ), | 125 | enablePainting( true ), |
126 | columnVisible( true ), | 126 | columnVisible( true ), |
127 | countNested( 0 ) | 127 | countNested( 0 ) |
128 | { | 128 | { |
129 | qWarning("C'tor start"); | 129 | //qWarning("C'tor start"); |
130 | 130 | ||
131 | setSelectionMode( NoSelection ); | 131 | setSelectionMode( NoSelection ); |
132 | init(); | 132 | init(); |
133 | setSorting( TRUE ); | 133 | setSorting( TRUE ); |
134 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), | 134 | connect( this, SIGNAL(clicked(int,int,int,const QPoint &)), |
135 | this, SLOT(itemClicked(int,int)) ); | 135 | this, SLOT(itemClicked(int,int)) ); |
136 | 136 | ||
137 | contactList.clear(); | 137 | contactList.clear(); |
138 | qWarning("C'tor end"); | 138 | //qWarning("C'tor end"); |
139 | } | 139 | } |
140 | 140 | ||
141 | AbTable::~AbTable() | 141 | AbTable::~AbTable() |
142 | { | 142 | { |
143 | } | 143 | } |
144 | 144 | ||
@@ -154,13 +154,13 @@ void AbTable::init() | |||
154 | verticalHeader()->hide(); | 154 | verticalHeader()->hide(); |
155 | columnVisible = true; | 155 | columnVisible = true; |
156 | } | 156 | } |
157 | 157 | ||
158 | void AbTable::setContacts( const OContactAccess::List& viewList ) | 158 | void AbTable::setContacts( const OContactAccess::List& viewList ) |
159 | { | 159 | { |
160 | qWarning("AbTable::setContacts()"); | 160 | //qWarning("AbTable::setContacts()"); |
161 | 161 | ||
162 | clear(); | 162 | clear(); |
163 | m_viewList = viewList; | 163 | m_viewList = viewList; |
164 | 164 | ||
165 | setSorting( false ); | 165 | setSorting( false ); |
166 | setPaintingEnabled( FALSE ); | 166 | setPaintingEnabled( FALSE ); |
@@ -180,13 +180,13 @@ void AbTable::setContacts( const OContactAccess::List& viewList ) | |||
180 | setPaintingEnabled( TRUE ); | 180 | setPaintingEnabled( TRUE ); |
181 | 181 | ||
182 | } | 182 | } |
183 | 183 | ||
184 | bool AbTable::selectContact( int UID ) | 184 | bool AbTable::selectContact( int UID ) |
185 | { | 185 | { |
186 | qWarning( "AbTable::selectContact( %d )", UID ); | 186 | //qWarning( "AbTable::selectContact( %d )", UID ); |
187 | int rows = numRows(); | 187 | int rows = numRows(); |
188 | AbTableItem *abi; | 188 | AbTableItem *abi; |
189 | OContact* foundContact = 0l; | 189 | OContact* foundContact = 0l; |
190 | bool found = false; | 190 | bool found = false; |
191 | 191 | ||
192 | setPaintingEnabled( FALSE ); | 192 | setPaintingEnabled( FALSE ); |
@@ -210,13 +210,13 @@ bool AbTable::selectContact( int UID ) | |||
210 | 210 | ||
211 | return true; | 211 | return true; |
212 | } | 212 | } |
213 | 213 | ||
214 | void AbTable::insertIntoTable( const OContact& cnt, int row ) | 214 | void AbTable::insertIntoTable( const OContact& cnt, int row ) |
215 | { | 215 | { |
216 | qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); | 216 | //qWarning( "void AbTable::insertIntoTable( const OContact& cnt, %d )", row ); |
217 | QString strName, | 217 | QString strName, |
218 | strContact; | 218 | strContact; |
219 | 219 | ||
220 | strName = findContactName( cnt ); | 220 | strName = findContactName( cnt ); |
221 | strContact = findContactContact( cnt, row ); | 221 | strContact = findContactContact( cnt, row ); |
222 | 222 | ||
@@ -251,13 +251,13 @@ void AbTable::columnClicked( int col ) | |||
251 | //QMessageBox::information( this, "resort", "columnClicked" ); | 251 | //QMessageBox::information( this, "resort", "columnClicked" ); |
252 | resort(); | 252 | resort(); |
253 | } | 253 | } |
254 | 254 | ||
255 | void AbTable::resort() | 255 | void AbTable::resort() |
256 | { | 256 | { |
257 | qWarning( "void AbTable::resort()" ); | 257 | //qWarning( "void AbTable::resort()" ); |
258 | setPaintingEnabled( FALSE ); | 258 | setPaintingEnabled( FALSE ); |
259 | if ( sorting() ) { | 259 | if ( sorting() ) { |
260 | if ( lastSortCol == -1 ) | 260 | if ( lastSortCol == -1 ) |
261 | lastSortCol = 0; | 261 | lastSortCol = 0; |
262 | sortColumn( lastSortCol, asc, TRUE ); | 262 | sortColumn( lastSortCol, asc, TRUE ); |
263 | //QMessageBox::information( this, "resort", "resort" ); | 263 | //QMessageBox::information( this, "resort", "resort" ); |
@@ -265,13 +265,13 @@ void AbTable::resort() | |||
265 | } | 265 | } |
266 | setPaintingEnabled( TRUE ); | 266 | setPaintingEnabled( TRUE ); |
267 | } | 267 | } |
268 | 268 | ||
269 | OContact AbTable::currentEntry() | 269 | OContact AbTable::currentEntry() |
270 | { | 270 | { |
271 | qWarning( "OContact AbTable::currentEntry()" ); | 271 | //qWarning( "OContact AbTable::currentEntry()" ); |
272 | OContact cnt; | 272 | OContact cnt; |
273 | AbTableItem *abItem; | 273 | AbTableItem *abItem; |
274 | abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); | 274 | abItem = static_cast<AbTableItem*>(item( currentRow(), 0 )); |
275 | if ( abItem ) { | 275 | if ( abItem ) { |
276 | cnt = contactList[abItem]; | 276 | cnt = contactList[abItem]; |
277 | //cnt = contactList[currentRow()]; | 277 | //cnt = contactList[currentRow()]; |
@@ -283,13 +283,13 @@ int AbTable::currentEntry_UID() | |||
283 | { | 283 | { |
284 | return ( currentEntry().uid() ); | 284 | return ( currentEntry().uid() ); |
285 | } | 285 | } |
286 | 286 | ||
287 | void AbTable::clear() | 287 | void AbTable::clear() |
288 | { | 288 | { |
289 | qWarning( "void AbTable::clear()" ); | 289 | //qWarning( "void AbTable::clear()" ); |
290 | contactList.clear(); | 290 | contactList.clear(); |
291 | 291 | ||
292 | setPaintingEnabled( FALSE ); | 292 | setPaintingEnabled( FALSE ); |
293 | for ( int r = 0; r < numRows(); ++r ) { | 293 | for ( int r = 0; r < numRows(); ++r ) { |
294 | for ( int c = 0; c < numCols(); ++c ) { | 294 | for ( int c = 0; c < numCols(); ++c ) { |
295 | if ( cellWidget( r, c ) ) | 295 | if ( cellWidget( r, c ) ) |
@@ -301,13 +301,13 @@ void AbTable::clear() | |||
301 | setPaintingEnabled( TRUE ); | 301 | setPaintingEnabled( TRUE ); |
302 | } | 302 | } |
303 | 303 | ||
304 | // Refresh updates column 2 if the contactsettings changed | 304 | // Refresh updates column 2 if the contactsettings changed |
305 | void AbTable::refresh() | 305 | void AbTable::refresh() |
306 | { | 306 | { |
307 | qWarning( "void AbTable::refresh()" ); | 307 | //qWarning( "void AbTable::refresh()" ); |
308 | int rows = numRows(); | 308 | int rows = numRows(); |
309 | QString value; | 309 | QString value; |
310 | AbTableItem *abi; | 310 | AbTableItem *abi; |
311 | 311 | ||
312 | setPaintingEnabled( FALSE ); | 312 | setPaintingEnabled( FALSE ); |
313 | for ( int r = 0; r < rows; ++r ) { | 313 | for ( int r = 0; r < rows; ++r ) { |
@@ -323,13 +323,13 @@ void AbTable::keyPressEvent( QKeyEvent *e ) | |||
323 | { | 323 | { |
324 | char key = toupper( e->ascii() ); | 324 | char key = toupper( e->ascii() ); |
325 | 325 | ||
326 | if ( key >= 'A' && key <= 'Z' ) | 326 | if ( key >= 'A' && key <= 'Z' ) |
327 | moveTo( key ); | 327 | moveTo( key ); |
328 | 328 | ||
329 | qWarning("Received key .."); | 329 | //qWarning("Received key .."); |
330 | switch( e->key() ) { | 330 | switch( e->key() ) { |
331 | case Qt::Key_Space: | 331 | case Qt::Key_Space: |
332 | case Qt::Key_Return: | 332 | case Qt::Key_Return: |
333 | case Qt::Key_Enter: | 333 | case Qt::Key_Enter: |
334 | emit signalSwitch(); | 334 | emit signalSwitch(); |
335 | break; | 335 | break; |
@@ -408,13 +408,13 @@ void AbTable::resizeRows() { | |||
408 | */ | 408 | */ |
409 | } | 409 | } |
410 | 410 | ||
411 | 411 | ||
412 | void AbTable::realignTable() | 412 | void AbTable::realignTable() |
413 | { | 413 | { |
414 | qWarning( "void AbTable::realignTable()" ); | 414 | //qWarning( "void AbTable::realignTable()" ); |
415 | 415 | ||
416 | setPaintingEnabled( FALSE ); | 416 | setPaintingEnabled( FALSE ); |
417 | 417 | ||
418 | resizeRows(); | 418 | resizeRows(); |
419 | fitColumns(); | 419 | fitColumns(); |
420 | 420 | ||
@@ -458,37 +458,37 @@ void QTable::paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch ) | |||
458 | // } | 458 | // } |
459 | 459 | ||
460 | 460 | ||
461 | 461 | ||
462 | void AbTable::fitColumns() | 462 | void AbTable::fitColumns() |
463 | { | 463 | { |
464 | qWarning( "void AbTable::fitColumns()" ); | 464 | //qWarning( "void AbTable::fitColumns()" ); |
465 | int contentsWidth = visibleWidth() / 2; // :SX Why too low | 465 | int contentsWidth = visibleWidth() / 2; // :SX Why too low |
466 | // Fix to better value | 466 | // Fix to better value |
467 | // contentsWidth = 130; | 467 | // contentsWidth = 130; |
468 | 468 | ||
469 | setPaintingEnabled( FALSE ); | 469 | setPaintingEnabled( FALSE ); |
470 | 470 | ||
471 | if ( columnVisible == false ){ | 471 | if ( columnVisible == false ){ |
472 | showColumn(0); | 472 | showColumn(0); |
473 | columnVisible = true; | 473 | columnVisible = true; |
474 | } | 474 | } |
475 | 475 | ||
476 | qWarning("Width: %d", contentsWidth); | 476 | //qWarning("Width: %d", contentsWidth); |
477 | 477 | ||
478 | setColumnWidth( 0, contentsWidth ); | 478 | setColumnWidth( 0, contentsWidth ); |
479 | adjustColumn(1); | 479 | adjustColumn(1); |
480 | if ( columnWidth(1) < contentsWidth ) | 480 | if ( columnWidth(1) < contentsWidth ) |
481 | setColumnWidth( 1, contentsWidth ); | 481 | setColumnWidth( 1, contentsWidth ); |
482 | 482 | ||
483 | setPaintingEnabled( TRUE ); | 483 | setPaintingEnabled( TRUE ); |
484 | } | 484 | } |
485 | 485 | ||
486 | void AbTable::show() | 486 | void AbTable::show() |
487 | { | 487 | { |
488 | qWarning( "void AbTable::show()" ); | 488 | //qWarning( "void AbTable::show()" ); |
489 | realignTable(); | 489 | realignTable(); |
490 | QTable::show(); | 490 | QTable::show(); |
491 | } | 491 | } |
492 | 492 | ||
493 | void AbTable::setChoiceNames( const QStringList& list) | 493 | void AbTable::setChoiceNames( const QStringList& list) |
494 | { | 494 | { |
@@ -504,17 +504,17 @@ void AbTable::setChoiceNames( const QStringList& list) | |||
504 | } | 504 | } |
505 | fitColumns(); | 505 | fitColumns(); |
506 | } | 506 | } |
507 | 507 | ||
508 | void AbTable::itemClicked(int,int col) | 508 | void AbTable::itemClicked(int,int col) |
509 | { | 509 | { |
510 | qWarning( "AbTable::itemClicked(int, col:%d)", col); | 510 | //qWarning( "AbTable::itemClicked(int, col:%d)", col); |
511 | if ( col == 2 ) { | 511 | if ( col == 2 ) { |
512 | return; | 512 | return; |
513 | } else { | 513 | } else { |
514 | qWarning ("Emitting signalSwitch()"); | 514 | // qWarning ("Emitting signalSwitch()"); |
515 | emit signalSwitch(); | 515 | emit signalSwitch(); |
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
519 | QStringList AbTable::choiceNames() const | 519 | QStringList AbTable::choiceNames() const |
520 | { | 520 | { |
@@ -545,13 +545,13 @@ QStringList AbTable::choiceSelection(int /*index*/) const | |||
545 | 545 | ||
546 | 546 | ||
547 | 547 | ||
548 | 548 | ||
549 | void AbTable::updateVisible() | 549 | void AbTable::updateVisible() |
550 | { | 550 | { |
551 | qWarning("void AbTable::updateVisible()"); | 551 | //qWarning("void AbTable::updateVisible()"); |
552 | 552 | ||
553 | int visible, | 553 | int visible, |
554 | totalRows, | 554 | totalRows, |
555 | row, | 555 | row, |
556 | selectedRow = 0; | 556 | selectedRow = 0; |
557 | 557 | ||
@@ -583,13 +583,13 @@ void AbTable::updateVisible() | |||
583 | 583 | ||
584 | } | 584 | } |
585 | 585 | ||
586 | 586 | ||
587 | void AbTable::setPaintingEnabled( bool e ) | 587 | void AbTable::setPaintingEnabled( bool e ) |
588 | { | 588 | { |
589 | qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); | 589 | //qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); |
590 | 590 | ||
591 | if ( e ) { | 591 | if ( e ) { |
592 | if ( countNested > 0 ) | 592 | if ( countNested > 0 ) |
593 | --countNested; | 593 | --countNested; |
594 | if ( ! countNested ){ | 594 | if ( ! countNested ){ |
595 | setUpdatesEnabled( true ); | 595 | setUpdatesEnabled( true ); |
@@ -599,17 +599,17 @@ void AbTable::setPaintingEnabled( bool e ) | |||
599 | } | 599 | } |
600 | } else { | 600 | } else { |
601 | ++countNested; | 601 | ++countNested; |
602 | enablePainting = false; | 602 | enablePainting = false; |
603 | setUpdatesEnabled( false ); | 603 | setUpdatesEnabled( false ); |
604 | } | 604 | } |
605 | qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); | 605 | //qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); |
606 | } | 606 | } |
607 | 607 | ||
608 | void AbTable::viewportPaintEvent( QPaintEvent* e ) { | 608 | void AbTable::viewportPaintEvent( QPaintEvent* e ) { |
609 | qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); | 609 | //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); |
610 | if ( enablePainting ) | 610 | if ( enablePainting ) |
611 | QTable::viewportPaintEvent( e ); | 611 | QTable::viewportPaintEvent( e ); |
612 | } | 612 | } |
613 | 613 | ||
614 | 614 | ||
615 | 615 | ||