Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 348f491..02fc40a 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -170,6 +170,7 @@ void KAddressBookTableView::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) @@ -179,9 +180,24 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) { //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() ); ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); + match = true; break; } } + if ( ! match ) { + if ( (*it).matchPhoneNumber( &re ) ) { + ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); + match = true; + break; + } + } + if ( ! match ) { + if ( (*it).matchAddress( &re ) ) { + ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); + match = true; + break; + } + } } } // Sometimes the background pixmap gets messed up when we add lots |