Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 91a7171..9297d6a 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -614,50 +614,58 @@ void QTable::paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch ) | |||
614 | QArray<QRect> r = reg.rects(); | 614 | QArray<QRect> r = reg.rects(); |
615 | for (unsigned int i=0; i<r.count(); i++) | 615 | for (unsigned int i=0; i<r.count(); i++) |
616 | p->fillRect( r[i], colorGroup().brush( QColorGroup::Base ) ); | 616 | p->fillRect( r[i], colorGroup().brush( QColorGroup::Base ) ); |
617 | } | 617 | } |
618 | #endif | 618 | #endif |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | 621 | ||
622 | // int AbTable::rowHeight( int ) const | 622 | // int AbTable::rowHeight( int ) const |
623 | // { | 623 | // { |
624 | // return 18; | 624 | // return 18; |
625 | // } | 625 | // } |
626 | 626 | ||
627 | // int AbTable::rowPos( int row ) const | 627 | // int AbTable::rowPos( int row ) const |
628 | // { | 628 | // { |
629 | // return 18*row; | 629 | // return 18*row; |
630 | // } | 630 | // } |
631 | 631 | ||
632 | // int AbTable::rowAt( int pos ) const | 632 | // int AbTable::rowAt( int pos ) const |
633 | // { | 633 | // { |
634 | // return QMIN( pos/18, numRows()-1 ); | 634 | // return QMIN( pos/18, numRows()-1 ); |
635 | // } | 635 | // } |
636 | 636 | ||
637 | void AbTable::slotDoFind( const QString &findString, bool caseSensitive, | 637 | void AbTable::slotDoFind( const QString &findString, bool caseSensitive, |
638 | bool backwards, int category ) | 638 | bool backwards, QString cat /* int category */ ) |
639 | { | 639 | { |
640 | int category = 0; | ||
641 | if ( cat.isEmpty() ) | ||
642 | category = -2; // mCat.id("Contacts", "All"); | ||
643 | else | ||
644 | category = mCat.id("Contacts", cat ); | ||
645 | |||
646 | qWarning ("Found in Category %d", category); | ||
647 | |||
640 | if ( currFindRow < -1 ) | 648 | if ( currFindRow < -1 ) |
641 | currFindRow = currentRow() - 1; | 649 | currFindRow = currentRow() - 1; |
642 | clearSelection( TRUE ); | 650 | clearSelection( TRUE ); |
643 | int rows, row; | 651 | int rows, row; |
644 | AbTableItem *ati; | 652 | AbTableItem *ati; |
645 | QRegExp r( findString ); | 653 | QRegExp r( findString ); |
646 | r.setCaseSensitive( caseSensitive ); | 654 | r.setCaseSensitive( caseSensitive ); |
647 | rows = numRows(); | 655 | rows = numRows(); |
648 | static bool wrapAround = true; | 656 | static bool wrapAround = true; |
649 | 657 | ||
650 | if ( !backwards ) { | 658 | if ( !backwards ) { |
651 | for ( row = currFindRow + 1; row < rows; row++ ) { | 659 | for ( row = currFindRow + 1; row < rows; row++ ) { |
652 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 660 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
653 | if ( contactCompare( contactList[ati], r, category ) ) | 661 | if ( contactCompare( contactList[ati], r, category ) ) |
654 | //if ( contactCompare( contactList[row], r, category ) ) | 662 | //if ( contactCompare( contactList[row], r, category ) ) |
655 | break; | 663 | break; |
656 | } | 664 | } |
657 | } else { | 665 | } else { |
658 | for ( row = currFindRow - 1; row > -1; row-- ) { | 666 | for ( row = currFindRow - 1; row > -1; row-- ) { |
659 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 667 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
660 | if ( contactCompare( contactList[ati], r, category ) ) | 668 | if ( contactCompare( contactList[ati], r, category ) ) |
661 | //if ( contactCompare( contactList[row], r, category ) ) | 669 | //if ( contactCompare( contactList[row], r, category ) ) |
662 | break; | 670 | break; |
663 | } | 671 | } |