author | zautrix <zautrix> | 2004-10-26 22:19:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-26 22:19:18 (UTC) |
commit | 6385f303bef3cbcd19d097a7b05c30e144d5dd6e (patch) (unidiff) | |
tree | 770795d94ea6ec1dc8bcaa67cc174a9c0add564a /kabc | |
parent | 13e996beddabc5e88f4f2fe49b2ce6cb8408eb30 (diff) | |
download | kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.zip kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.gz kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.bz2 |
implemented remove sync info for kopi and kapi
-rw-r--r-- | kabc/addressbook.cpp | 8 | ||||
-rw-r--r-- | kabc/addressbook.h | 1 | ||||
-rw-r--r-- | kabc/addressee.cpp | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 3641c0c..2785131 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -544,24 +544,32 @@ void AddressBook::removeUntagged() | |||
544 | deleteRemovedAddressees(); | 544 | deleteRemovedAddressees(); |
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) | ||
557 | { | ||
558 | Iterator ait; | ||
559 | for ( ait = begin(); ait != end(); ++ait ) { | ||
560 | (*ait).removeID( syncProfile ); | ||
561 | } | ||
562 | |||
563 | } | ||
556 | void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) | 564 | void AddressBook::preparePhoneSync( QString currentSyncDevice, bool isPreSync ) |
557 | { | 565 | { |
558 | Iterator ait; | 566 | Iterator ait; |
559 | for ( ait = begin(); ait != end(); ++ait ) { | 567 | for ( ait = begin(); ait != end(); ++ait ) { |
560 | QString id = (*ait).IDStr(); | 568 | QString id = (*ait).IDStr(); |
561 | (*ait).setIDStr( ":"); | 569 | (*ait).setIDStr( ":"); |
562 | (*ait).setExternalUID( id ); | 570 | (*ait).setExternalUID( id ); |
563 | (*ait).setOriginalExternalUID( id ); | 571 | (*ait).setOriginalExternalUID( id ); |
564 | if ( isPreSync ) | 572 | if ( isPreSync ) |
565 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); | 573 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); |
566 | else { | 574 | else { |
567 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 575 | (*ait).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
diff --git a/kabc/addressbook.h b/kabc/addressbook.h index 5edca06..f124dc9 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h | |||
@@ -135,24 +135,25 @@ class AddressBook : public QObject | |||
135 | bool load(); | 135 | bool load(); |
136 | 136 | ||
137 | /** | 137 | /** |
138 | Save address book. The address book is saved to the file, the Ticket | 138 | Save address book. The address book is saved to the file, the Ticket |
139 | object has been requested for by @ref requestSaveTicket(). | 139 | object has been requested for by @ref requestSaveTicket(). |
140 | 140 | ||
141 | @param ticket a ticket object returned by @ref requestSaveTicket() | 141 | @param ticket a ticket object returned by @ref requestSaveTicket() |
142 | */ | 142 | */ |
143 | bool save( Ticket *ticket ); | 143 | bool save( Ticket *ticket ); |
144 | bool saveAB( ); | 144 | bool saveAB( ); |
145 | bool saveABphone( QString fileName ); | 145 | bool saveABphone( QString fileName ); |
146 | void smplifyAddressees(); | 146 | void smplifyAddressees(); |
147 | void removeSyncInfo( QString syncProfile); | ||
147 | void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); | 148 | void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); |
148 | void export2File( QString fileName ); | 149 | void export2File( QString fileName ); |
149 | bool export2PhoneFormat( QStringList uids ,QString fileName ); | 150 | bool export2PhoneFormat( QStringList uids ,QString fileName ); |
150 | int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); | 151 | int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); |
151 | void setUntagged( bool setNonSyncTagged = false ); | 152 | void setUntagged( bool setNonSyncTagged = false ); |
152 | void removeUntagged(); | 153 | void removeUntagged(); |
153 | void findNewExtIds( QString fileName, QString currentSyncDevice ); | 154 | void findNewExtIds( QString fileName, QString currentSyncDevice ); |
154 | /** | 155 | /** |
155 | Returns a iterator for first entry of address book. | 156 | Returns a iterator for first entry of address book. |
156 | */ | 157 | */ |
157 | Iterator begin(); | 158 | Iterator begin(); |
158 | 159 | ||
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 40877ef..a660a9d 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -544,25 +544,28 @@ void Addressee::simplifyPhoneNumbers() | |||
544 | } | 544 | } |
545 | } | 545 | } |
546 | void Addressee::simplifyPhoneNumberTypes() | 546 | void Addressee::simplifyPhoneNumberTypes() |
547 | { | 547 | { |
548 | KABC::PhoneNumber::List::Iterator phoneIter; | 548 | KABC::PhoneNumber::List::Iterator phoneIter; |
549 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); | 549 | for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); |
550 | ++phoneIter ) | 550 | ++phoneIter ) |
551 | ( *phoneIter ).simplifyType(); | 551 | ( *phoneIter ).simplifyType(); |
552 | } | 552 | } |
553 | void Addressee::removeID(const QString &prof) | 553 | void Addressee::removeID(const QString &prof) |
554 | { | 554 | { |
555 | detach(); | 555 | detach(); |
556 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 556 | if ( prof.isEmpty() ) |
557 | mData->mExternalId = ":"; | ||
558 | else | ||
559 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | ||
557 | 560 | ||
558 | } | 561 | } |
559 | void Addressee::setID( const QString & prof , const QString & id ) | 562 | void Addressee::setID( const QString & prof , const QString & id ) |
560 | { | 563 | { |
561 | detach(); | 564 | detach(); |
562 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 565 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
563 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 566 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
564 | } | 567 | } |
565 | void Addressee::setTempSyncStat( int id ) | 568 | void Addressee::setTempSyncStat( int id ) |
566 | { | 569 | { |
567 | if ( mData->mTempSyncStat == id ) return; | 570 | if ( mData->mTempSyncStat == id ) return; |
568 | detach(); | 571 | detach(); |