Diffstat (limited to 'kaddressbook/views/kaddressbookcardview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index ca21016..b503652 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp @@ -329,6 +329,7 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; + bool match = false; for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { #if QT_VERSION >= 0x030000 if (re.search((*fieldIt)->value( *it ).lower()) == 0) @@ -336,11 +337,28 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) if (re.match((*fieldIt)->value( *it ).lower()) == 0) #endif { - new AddresseeCardViewItem(fields(), mShowEmptyFields, - addressBook(), *it, mCardView); + new AddresseeCardViewItem(fields(), mShowEmptyFields, + addressBook(), *it, mCardView); + match = true; break; } } + if ( ! match ) { + if ( (*it).matchPhoneNumber( &re ) ) { + new AddresseeCardViewItem(fields(), mShowEmptyFields, + addressBook(), *it, mCardView); + match = true; + break; + } + } + if ( ! match ) { + if ( (*it).matchAddress( &re ) ) { + new AddresseeCardViewItem(fields(), mShowEmptyFields, + addressBook(), *it, mCardView); + match = true; + break; + } + } } } mCardView->viewport()->setUpdatesEnabled( true ); |