author | zautrix <zautrix> | 2004-10-27 10:36:51 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 10:36:51 (UTC) |
commit | ce5b6b62c92cc051c5c9e780508b6d42c46df8ed (patch) (unidiff) | |
tree | 257fa9c582c6f8c0bd1948a04e8f4083862932a8 /kabc | |
parent | 835411009ea43a8182b16b78c03b11616f989f50 (diff) | |
download | kdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.zip kdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.tar.gz kdepimpi-ce5b6b62c92cc051c5c9e780508b6d42c46df8ed.tar.bz2 |
fixed remove sync info
-rw-r--r-- | kabc/addressbook.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 2785131..df0fba4 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -545,32 +545,53 @@ void AddressBook::removeUntagged() | |||
545 | } | 545 | } |
546 | void AddressBook::smplifyAddressees() | 546 | void AddressBook::smplifyAddressees() |
547 | { | 547 | { |
548 | Iterator ait; | 548 | Iterator ait; |
549 | for ( ait = begin(); ait != end(); ++ait ) { | 549 | for ( ait = begin(); ait != end(); ++ait ) { |
550 | (*ait).simplifyEmails(); | 550 | (*ait).simplifyEmails(); |
551 | (*ait).simplifyPhoneNumbers(); | 551 | (*ait).simplifyPhoneNumbers(); |
552 | (*ait).simplifyPhoneNumberTypes(); | 552 | (*ait).simplifyPhoneNumberTypes(); |
553 | (*ait).simplifyAddresses(); | 553 | (*ait).simplifyAddresses(); |
554 | } | 554 | } |
555 | } | 555 | } |
556 | void AddressBook::removeSyncInfo( QString syncProfile) | 556 | void AddressBook::removeSyncInfo( QString syncProfile) |
557 | { | 557 | { |
558 | Iterator ait; | 558 | Iterator ait; |
559 | for ( ait = begin(); ait != end(); ++ait ) { | 559 | for ( ait = begin(); ait != end(); ++ait ) { |
560 | (*ait).removeID( syncProfile ); | 560 | (*ait).removeID( syncProfile ); |
561 | } | ||
562 | if ( syncProfile.isEmpty() ) { | ||
563 | Iterator it = begin(); | ||
564 | Iterator it2 ; | ||
565 | QDateTime dt ( QDate( 2004,1,1) ); | ||
566 | while ( it != end() ) { | ||
567 | if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) { | ||
568 | it2 = it; | ||
569 | //qDebug("removing %s ",(*it).uid().latin1() ); | ||
570 | ++it; | ||
571 | removeAddressee( it2 ); | ||
572 | } else { | ||
573 | //qDebug("skipping %s ",(*it).uid().latin1() ); | ||
574 | ++it; | ||
575 | } | ||
576 | } | ||
577 | } else { | ||
578 | Addressee lse; | ||
579 | lse = mAddressBook->findByUid( "last-syncAddressee-"+ syncProfile ); | ||
580 | if ( ! lse.isEmpty() ) | ||
581 | removeAddressee( lse ); | ||
561 | } | 582 | } |
562 | 583 | ||
563 | } | 584 | } |
564 | void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) | 585 | void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) |
565 | { | 586 | { |
566 | Iterator ait; | 587 | Iterator ait; |
567 | for ( ait = begin(); ait != end(); ++ait ) { | 588 | for ( ait = begin(); ait != end(); ++ait ) { |
568 | QString id = (*ait).IDStr(); | 589 | QString id = (*ait).IDStr(); |
569 | (*ait).setIDStr( ":"); | 590 | (*ait).setIDStr( ":"); |
570 | (*ait).setExternalUID( id ); | 591 | (*ait).setExternalUID( id ); |
571 | (*ait).setOriginalExternalUID( id ); | 592 | (*ait).setOriginalExternalUID( id ); |
572 | if ( isPreSync ) | 593 | if ( isPreSync ) |
573 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); | 594 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); |
574 | else { | 595 | else { |
575 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 596 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
576 | (*ait).setID( currentSyncDevice,id ); | 597 | (*ait).setID( currentSyncDevice,id ); |