summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-07-05 09:51:38 (UTC)
committer zautrix <zautrix>2004-07-05 09:51:38 (UTC)
commit93f9b1e0a8935210b03a094ce18949b7197041aa (patch) (unidiff)
treef9d4a531755ead00068367f56c4987446e59af13
parent5c5c1354afa5d24768ceefe5b7dd8733ff7bd5f0 (diff)
downloadkdepimpi-93f9b1e0a8935210b03a094ce18949b7197041aa.zip
kdepimpi-93f9b1e0a8935210b03a094ce18949b7197041aa.tar.gz
kdepimpi-93f9b1e0a8935210b03a094ce18949b7197041aa.tar.bz2
Fixed searching order
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index b06e1bc..7cba9aa 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -646,49 +646,49 @@ void KABCore::setCategories()
646 } 646 }
647 647
648 mAddressBook->insertAddressee( addr ); 648 mAddressBook->insertAddressee( addr );
649 } 649 }
650 } 650 }
651 651
652 if ( uids.count() > 0 ) 652 if ( uids.count() > 0 )
653 setModified( true ); 653 setModified( true );
654} 654}
655 655
656void KABCore::setSearchFields( const KABC::Field::List &fields ) 656void KABCore::setSearchFields( const KABC::Field::List &fields )
657{ 657{
658 mIncSearchWidget->setFields( fields ); 658 mIncSearchWidget->setFields( fields );
659} 659}
660 660
661void KABCore::incrementalSearch( const QString& text ) 661void KABCore::incrementalSearch( const QString& text )
662{ 662{
663 mViewManager->setSelected( QString::null, false ); 663 mViewManager->setSelected( QString::null, false );
664 664
665 if ( !text.isEmpty() ) { 665 if ( !text.isEmpty() ) {
666 KABC::Field *field = mIncSearchWidget->currentField(); 666 KABC::Field *field = mIncSearchWidget->currentField();
667 667
668 QString pattern = text.lower(); 668 QString pattern = text.lower();
669 669
670#if KDE_VERSION >= 319 670#if 1 //KDE_VERSION >= 319
671 KABC::AddresseeList list( mAddressBook->allAddressees() ); 671 KABC::AddresseeList list( mAddressBook->allAddressees() );
672 if ( field ) { 672 if ( field ) {
673 list.sortByField( field ); 673 list.sortByField( field );
674 KABC::AddresseeList::Iterator it; 674 KABC::AddresseeList::Iterator it;
675 for ( it = list.begin(); it != list.end(); ++it ) { 675 for ( it = list.begin(); it != list.end(); ++it ) {
676 if ( field->value( *it ).lower().startsWith( pattern ) ) { 676 if ( field->value( *it ).lower().startsWith( pattern ) ) {
677 mViewManager->setSelected( (*it).uid(), true ); 677 mViewManager->setSelected( (*it).uid(), true );
678 return; 678 return;
679 } 679 }
680 } 680 }
681 } else { 681 } else {
682 KABC::AddresseeList::Iterator it; 682 KABC::AddresseeList::Iterator it;
683 for ( it = list.begin(); it != list.end(); ++it ) { 683 for ( it = list.begin(); it != list.end(); ++it ) {
684 KABC::Field::List fieldList = mIncSearchWidget->fields(); 684 KABC::Field::List fieldList = mIncSearchWidget->fields();
685 KABC::Field::List::ConstIterator fieldIt; 685 KABC::Field::List::ConstIterator fieldIt;
686 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { 686 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
687 if ( (*fieldIt)->value( *it ).lower().startsWith( pattern ) ) { 687 if ( (*fieldIt)->value( *it ).lower().startsWith( pattern ) ) {
688 mViewManager->setSelected( (*it).uid(), true ); 688 mViewManager->setSelected( (*it).uid(), true );
689 return; 689 return;
690 } 690 }
691 } 691 }
692 } 692 }
693 } 693 }
694#else 694#else