summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
authorzautrix <zautrix>2004-09-20 00:12:42 (UTC)
committer zautrix <zautrix>2004-09-20 00:12:42 (UTC)
commitb01b669d88fa195261d29ecf73b1c69e608a5ebc (patch) (side-by-side diff)
treec0e79d45242a764b49470d07a9c95be156c121cc /kabc/addressbook.cpp
parent3da2cfeab2edbe64a17251662e56668fe143f7a3 (diff)
downloadkdepimpi-b01b669d88fa195261d29ecf73b1c69e608a5ebc.zip
kdepimpi-b01b669d88fa195261d29ecf73b1c69e608a5ebc.tar.gz
kdepimpi-b01b669d88fa195261d29ecf73b1c69e608a5ebc.tar.bz2
more AB sync
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 86dc7c2..17b9ba2 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -554,5 +554,4 @@ void AddressBook::removeAddressee( const Addressee &a )
-void AddressBook::removeDeletedAddressees()
+void AddressBook::removeSyncAddressees( bool removeDeleted )
{
- deleteRemovedAddressees();
Iterator it = begin();
@@ -564,3 +563,3 @@ void AddressBook::removeDeletedAddressees()
(*it).setIDStr("");
- if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE || (*it).uid().left( 19 ) == QString("last-syncAddressee-")) {
+ if ( ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE && removeDeleted )|| (*it).uid().left( 19 ) == QString("last-syncAddressee-")) {
it2 = it;
@@ -569,3 +568,3 @@ void AddressBook::removeDeletedAddressees()
removeAddressee( it2 );
- } else {
+ } else {
//qDebug("skipping %s ",(*it).uid().latin1() );
@@ -619,2 +618,3 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd)
for ( it = begin(); it != end(); ++it ) {
+ qDebug("check uid %s ", (*it).uid().latin1() );
if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ||
@@ -623,3 +623,3 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd)
if ( ad.isEmpty() ) {
- qDebug("ERROR ad empty ");
+ qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1());
} else {
@@ -635,3 +635,11 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd)
-
+bool AddressBook::containsExternalUid( const QString& uid )
+{
+ Iterator it;
+ for ( it = begin(); it != end(); ++it ) {
+ if ( uid == (*it).externalUID( ) )
+ return true;
+ }
+ return false;
+}
Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile )
@@ -655,2 +663,9 @@ void AddressBook::mergeAB( AddressBook *aBook, const QString& profile )
}
+#if 0
+ // test only
+ for ( it = begin(); it != end(); ++it ) {
+
+ qDebug("uid %s ", (*it).uid().latin1());
+ }
+#endif
}