Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 97b26db..4feadeb 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -688,3 +688,6 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
688 | static bool wrapAround = true; | 688 | static bool wrapAround = true; |
689 | bool try_again = false; | ||
689 | 690 | ||
691 | // We will loop until we found an entry or found nothing. | ||
692 | do { | ||
690 | if ( !backwards ) { | 693 | if ( !backwards ) { |
@@ -692,5 +695,7 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
692 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 695 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
693 | if ( contactCompare( contactList[ati], r, category ) ) | 696 | if ( contactCompare( contactList[ati], r, category ) ){ |
697 | try_again = false; | ||
694 | break; | 698 | break; |
695 | } | 699 | } |
700 | } | ||
696 | } else { | 701 | } else { |
@@ -698,3 +703,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
698 | ati = static_cast<AbTableItem*>( item(row, 0) ); | 703 | ati = static_cast<AbTableItem*>( item(row, 0) ); |
699 | if ( contactCompare( contactList[ati], r, category ) ) | 704 | if ( contactCompare( contactList[ati], r, category ) ){ |
705 | try_again = false; | ||
700 | break; | 706 | break; |
@@ -702,2 +708,3 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
702 | } | 708 | } |
709 | } | ||
703 | if ( row >= rows || row < 0 ) { | 710 | if ( row >= rows || row < 0 ) { |
@@ -708,6 +715,9 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
708 | 715 | ||
709 | if ( wrapAround ) | 716 | if ( wrapAround ){ |
710 | emit signalWrapAround(); | 717 | emit signalWrapAround(); |
711 | else | 718 | try_again = true; |
719 | }else{ | ||
712 | emit signalNotFound(); | 720 | emit signalNotFound(); |
721 | try_again = false; | ||
722 | } | ||
713 | 723 | ||
@@ -722,3 +732,5 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us | |||
722 | wrapAround = true; | 732 | wrapAround = true; |
733 | try_again = false; | ||
723 | } | 734 | } |
735 | } while ( try_again ); | ||
724 | } | 736 | } |