Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 9297d6a..97f4a8f 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -129,5 +129,5 @@ AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *nam | |||
129 | asc( TRUE ), | 129 | asc( TRUE ), |
130 | intFields( order ), | 130 | intFields( order ), |
131 | currFindRow( -2 ), | 131 | currFindRow( -1 ), |
132 | mCat( 0 ), | 132 | mCat( 0 ), |
133 | m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! | 133 | m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. ! |
@@ -639,13 +639,17 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, | |||
639 | { | 639 | { |
640 | int category = 0; | 640 | int category = 0; |
641 | |||
642 | // Use the current Category if nothing else selected | ||
641 | if ( cat.isEmpty() ) | 643 | if ( cat.isEmpty() ) |
642 | category = -2; // mCat.id("Contacts", "All"); | 644 | category = mCat.id( "Contacts", showCat ); |
643 | else | 645 | else{ |
644 | category = mCat.id("Contacts", cat ); | 646 | category = mCat.id("Contacts", cat ); |
647 | } | ||
645 | 648 | ||
646 | qWarning ("Found in Category %d", category); | 649 | qWarning ("Found in Category %d", category); |
647 | 650 | ||
648 | if ( currFindRow < -1 ) | 651 | if ( currFindRow < -1 ) |
649 | currFindRow = currentRow() - 1; | 652 | currFindRow = - 1; |
653 | |||
650 | clearSelection( TRUE ); | 654 | clearSelection( TRUE ); |
651 | int rows, row; | 655 | int rows, row; |
@@ -660,5 +664,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, | |||
660 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 664 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
661 | if ( contactCompare( contactList[ati], r, category ) ) | 665 | if ( contactCompare( contactList[ati], r, category ) ) |
662 | //if ( contactCompare( contactList[row], r, category ) ) | ||
663 | break; | 666 | break; |
664 | } | 667 | } |
@@ -667,5 +670,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, | |||
667 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 670 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
668 | if ( contactCompare( contactList[ati], r, category ) ) | 671 | if ( contactCompare( contactList[ati], r, category ) ) |
669 | //if ( contactCompare( contactList[row], r, category ) ) | ||
670 | break; | 672 | break; |
671 | } | 673 | } |
@@ -689,5 +691,5 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, | |||
689 | foundSelection.expandTo( currFindRow, numCols() - 1 ); | 691 | foundSelection.expandTo( currFindRow, numCols() - 1 ); |
690 | addSelection( foundSelection ); | 692 | addSelection( foundSelection ); |
691 | setCurrentCell( currFindRow, numCols() - 1 ); | 693 | setCurrentCell( currFindRow, 0 /* numCols() - 1 */ ); |
692 | wrapAround = true; | 694 | wrapAround = true; |
693 | } | 695 | } |
@@ -701,5 +703,5 @@ static bool contactCompare( const OContact &cnt, const QRegExp &r, int category | |||
701 | 703 | ||
702 | returnMe = false; | 704 | returnMe = false; |
703 | if ( (category == -1 && cats.count() == 0) || category == -2 ) | 705 | if ( (cats.count() == 0) || (category == 0) ) |
704 | returnMe = cnt.match( r ); | 706 | returnMe = cnt.match( r ); |
705 | else { | 707 | else { |