author | zautrix <zautrix> | 2004-09-21 07:05:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-21 07:05:01 (UTC) |
commit | 434ddaa08e0a650422ef271332a1d11879028095 (patch) (unidiff) | |
tree | e4f229120d8bfa9febb7ab123b1311329f0e6aa4 /kabc/addressbook.cpp | |
parent | ed49c55dac215ac2ed9286ebfc36e5a19417f0bb (diff) | |
download | kdepimpi-434ddaa08e0a650422ef271332a1d11879028095.zip kdepimpi-434ddaa08e0a650422ef271332a1d11879028095.tar.gz kdepimpi-434ddaa08e0a650422ef271332a1d11879028095.tar.bz2 |
DTM sync fixes
-rw-r--r-- | kabc/addressbook.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index adb451f..5fb49eb 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -232,19 +232,17 @@ AddressBook::AddressBook( const QString &config, const QString &family ) | |||
232 | } | 232 | } |
233 | 233 | ||
234 | // the default family is "contact" | 234 | // the default family is "contact" |
235 | void AddressBook::init(const QString &config, const QString &family ) | 235 | void AddressBook::init(const QString &config, const QString &family ) |
236 | { | 236 | { |
237 | blockLSEchange = false; | 237 | blockLSEchange = false; |
238 | d = new AddressBookData; | 238 | d = new AddressBookData; |
239 | QString fami = family; | 239 | QString fami = family; |
240 | qDebug("new ab "); | ||
241 | if (config != 0) { | 240 | if (config != 0) { |
242 | qDebug("config != 0 "); | ||
243 | if ( family == "syncContact" ) { | 241 | if ( family == "syncContact" ) { |
244 | qDebug("creating sync config "); | 242 | qDebug("creating sync config "); |
245 | fami = "contact"; | 243 | fami = "contact"; |
246 | KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); | 244 | KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); |
247 | con->setGroup( "General" ); | 245 | con->setGroup( "General" ); |
248 | con->writeEntry( "ResourceKeys", QString("sync") ); | 246 | con->writeEntry( "ResourceKeys", QString("sync") ); |
249 | con->writeEntry( "Standard", QString("sync") ); | 247 | con->writeEntry( "Standard", QString("sync") ); |
250 | con->setGroup( "Resource_sync" ); | 248 | con->setGroup( "Resource_sync" ); |
@@ -601,30 +599,30 @@ Addressee AddressBook::findByUid( const QString &uid ) | |||
601 | if ( uid == (*it).uid() ) { | 599 | if ( uid == (*it).uid() ) { |
602 | return *it; | 600 | return *it; |
603 | } | 601 | } |
604 | } | 602 | } |
605 | return Addressee(); | 603 | return Addressee(); |
606 | } | 604 | } |
607 | void AddressBook::preExternSync( AddressBook* aBook, const QString& csd ) | 605 | void AddressBook::preExternSync( AddressBook* aBook, const QString& csd ) |
608 | { | 606 | { |
609 | qDebug("AddressBook::preExternSync "); | 607 | //qDebug("AddressBook::preExternSync "); |
610 | AddressBook::Iterator it; | 608 | AddressBook::Iterator it; |
611 | for ( it = begin(); it != end(); ++it ) { | 609 | for ( it = begin(); it != end(); ++it ) { |
612 | (*it).setID( csd, (*it).externalUID() ); | 610 | (*it).setID( csd, (*it).externalUID() ); |
613 | (*it).computeCsum( csd ); | 611 | (*it).computeCsum( csd ); |
614 | } | 612 | } |
615 | mergeAB( aBook ,csd ); | 613 | mergeAB( aBook ,csd ); |
616 | } | 614 | } |
617 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) | 615 | void AddressBook::postExternSync( AddressBook* aBook , const QString& csd) |
618 | { | 616 | { |
619 | qDebug("AddressBook::postExternSync "); | 617 | //qDebug("AddressBook::postExternSync "); |
620 | AddressBook::Iterator it; | 618 | AddressBook::Iterator it; |
621 | for ( it = begin(); it != end(); ++it ) { | 619 | for ( it = begin(); it != end(); ++it ) { |
622 | qDebug("check uid %s ", (*it).uid().latin1() ); | 620 | // qDebug("check uid %s ", (*it).uid().latin1() ); |
623 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || | 621 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || |
624 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ) { | 622 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ) { |
625 | Addressee ad = aBook->findByUid( ( (*it).uid() )); | 623 | Addressee ad = aBook->findByUid( ( (*it).uid() )); |
626 | if ( ad.isEmpty() ) { | 624 | if ( ad.isEmpty() ) { |
627 | qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); | 625 | qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); |
628 | } else { | 626 | } else { |
629 | (*it).computeCsum( csd ); | 627 | (*it).computeCsum( csd ); |
630 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) | 628 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) |