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 static bool wrapAround = true; + bool try_again = false; + // We will loop until we found an entry or found nothing. + do { if ( !backwards ) { @@ -692,5 +695,7 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us ati = static_cast<AbTableItem*>( item(row, 0) ); - if ( contactCompare( contactList[ati], r, category ) ) + if ( contactCompare( contactList[ati], r, category ) ){ + try_again = false; break; } + } } else { @@ -698,3 +703,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us ati = static_cast<AbTableItem*>( item(row, 0) ); - if ( contactCompare( contactList[ati], r, category ) ) + if ( contactCompare( contactList[ati], r, category ) ){ + try_again = false; break; @@ -702,2 +708,3 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us } + } if ( row >= rows || row < 0 ) { @@ -708,6 +715,9 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us - if ( wrapAround ) + if ( wrapAround ){ emit signalWrapAround(); - else + try_again = true; + }else{ emit signalNotFound(); + try_again = false; + } @@ -722,3 +732,5 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive, bool us wrapAround = true; + try_again = false; } + } while ( try_again ); } |