-rw-r--r-- | kabc/addressbook.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 9332e21..6e8d027 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -484,105 +484,112 @@ void AddressBook::removeAddressee( const Addressee &a ) | |||
484 | return; | 484 | return; |
485 | } | 485 | } |
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 | ||
489 | void AddressBook::removeAddressee( const Iterator &it ) | 489 | void AddressBook::removeAddressee( const Iterator &it ) |
490 | { | 490 | { |
491 | d->mRemovedAddressees.append( (*it) ); | 491 | d->mRemovedAddressees.append( (*it) ); |
492 | d->mAddressees.remove( it.d->mIt ); | 492 | d->mAddressees.remove( it.d->mIt ); |
493 | } | 493 | } |
494 | 494 | ||
495 | AddressBook::Iterator AddressBook::find( const Addressee &a ) | 495 | AddressBook::Iterator AddressBook::find( const Addressee &a ) |
496 | { | 496 | { |
497 | Iterator it; | 497 | Iterator it; |
498 | for ( it = begin(); it != end(); ++it ) { | 498 | for ( it = begin(); it != end(); ++it ) { |
499 | if ( a.uid() == (*it).uid() ) { | 499 | if ( a.uid() == (*it).uid() ) { |
500 | return it; | 500 | return it; |
501 | } | 501 | } |
502 | } | 502 | } |
503 | return end(); | 503 | return end(); |
504 | } | 504 | } |
505 | 505 | ||
506 | Addressee AddressBook::findByUid( const QString &uid ) | 506 | Addressee AddressBook::findByUid( const QString &uid ) |
507 | { | 507 | { |
508 | Iterator it; | 508 | Iterator it; |
509 | for ( it = begin(); it != end(); ++it ) { | 509 | for ( it = begin(); it != end(); ++it ) { |
510 | if ( uid == (*it).uid() ) { | 510 | if ( uid == (*it).uid() ) { |
511 | return *it; | 511 | return *it; |
512 | } | 512 | } |
513 | } | 513 | } |
514 | return Addressee(); | 514 | return Addressee(); |
515 | } | 515 | } |
516 | Addressee::List AddressBook::getExternLastSyncAddressees() | 516 | Addressee::List AddressBook::getExternLastSyncAddressees() |
517 | { | 517 | { |
518 | Addressee::List results; | 518 | Addressee::List results; |
519 | 519 | ||
520 | Iterator it; | 520 | Iterator it; |
521 | for ( it = begin(); it != end(); ++it ) { | 521 | for ( it = begin(); it != end(); ++it ) { |
522 | if ( (*it).uid().left( 20 ) == "last-syncAddressee-" ) { | 522 | if ( (*it).uid().left( 20 ) == "last-syncAddressee-" ) { |
523 | if ( (*it).familyName().left(3) == "E: " ) | 523 | if ( (*it).familyName().left(3) == "E: " ) |
524 | results.append( *it ); | 524 | results.append( *it ); |
525 | } | 525 | } |
526 | } | 526 | } |
527 | 527 | ||
528 | return results; | 528 | return results; |
529 | } | 529 | } |
530 | void AddressBook::resetTempSyncStat() | 530 | void AddressBook::resetTempSyncStat() |
531 | { | 531 | { |
532 | 532 | Iterator it; | |
533 | |||
534 | Iterator it; | ||
535 | for ( it = begin(); it != end(); ++it ) { | 533 | for ( it = begin(); it != end(); ++it ) { |
536 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); | 534 | (*it).setTempSyncStat ( SYNC_TEMPSTATE_INITIAL ); |
537 | } | 535 | } |
538 | 536 | ||
539 | } | 537 | } |
540 | 538 | ||
539 | QStringList AddressBook:: uidList() | ||
540 | { | ||
541 | QStringList results; | ||
542 | Iterator it; | ||
543 | for ( it = begin(); it != end(); ++it ) { | ||
544 | results.append( (*it).uid() ); | ||
545 | } | ||
546 | return results; | ||
547 | } | ||
541 | 548 | ||
542 | 549 | ||
543 | Addressee::List AddressBook::allAddressees() | 550 | Addressee::List AddressBook::allAddressees() |
544 | { | 551 | { |
545 | return d->mAddressees; | 552 | return d->mAddressees; |
546 | } | 553 | } |
547 | 554 | ||
548 | Addressee::List AddressBook::findByName( const QString &name ) | 555 | Addressee::List AddressBook::findByName( const QString &name ) |
549 | { | 556 | { |
550 | Addressee::List results; | 557 | Addressee::List results; |
551 | 558 | ||
552 | Iterator it; | 559 | Iterator it; |
553 | for ( it = begin(); it != end(); ++it ) { | 560 | for ( it = begin(); it != end(); ++it ) { |
554 | if ( name == (*it).realName() ) { | 561 | if ( name == (*it).realName() ) { |
555 | results.append( *it ); | 562 | results.append( *it ); |
556 | } | 563 | } |
557 | } | 564 | } |
558 | 565 | ||
559 | return results; | 566 | return results; |
560 | } | 567 | } |
561 | 568 | ||
562 | Addressee::List AddressBook::findByEmail( const QString &email ) | 569 | Addressee::List AddressBook::findByEmail( const QString &email ) |
563 | { | 570 | { |
564 | Addressee::List results; | 571 | Addressee::List results; |
565 | QStringList mailList; | 572 | QStringList mailList; |
566 | 573 | ||
567 | Iterator it; | 574 | Iterator it; |
568 | for ( it = begin(); it != end(); ++it ) { | 575 | for ( it = begin(); it != end(); ++it ) { |
569 | mailList = (*it).emails(); | 576 | mailList = (*it).emails(); |
570 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { | 577 | for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { |
571 | if ( email == (*ite) ) { | 578 | if ( email == (*ite) ) { |
572 | results.append( *it ); | 579 | results.append( *it ); |
573 | } | 580 | } |
574 | } | 581 | } |
575 | } | 582 | } |
576 | 583 | ||
577 | return results; | 584 | return results; |
578 | } | 585 | } |
579 | 586 | ||
580 | Addressee::List AddressBook::findByCategory( const QString &category ) | 587 | Addressee::List AddressBook::findByCategory( const QString &category ) |
581 | { | 588 | { |
582 | Addressee::List results; | 589 | Addressee::List results; |
583 | 590 | ||
584 | Iterator it; | 591 | Iterator it; |
585 | for ( it = begin(); it != end(); ++it ) { | 592 | for ( it = begin(); it != end(); ++it ) { |
586 | if ( (*it).hasCategory( category) ) { | 593 | if ( (*it).hasCategory( category) ) { |
587 | results.append( *it ); | 594 | results.append( *it ); |
588 | } | 595 | } |