author | zautrix <zautrix> | 2004-09-19 11:32:40 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-19 11:32:40 (UTC) |
commit | eea0ff04703dffdbe8b67a0dc9f592597d7450c1 (patch) (unidiff) | |
tree | 874549d9c1c6239304fe1540d1b56269652954c0 /kabc/addressbook.cpp | |
parent | 953277a85e6ec5630ab0d64b4d68815e4e4f9906 (diff) | |
download | kdepimpi-eea0ff04703dffdbe8b67a0dc9f592597d7450c1.zip kdepimpi-eea0ff04703dffdbe8b67a0dc9f592597d7450c1.tar.gz kdepimpi-eea0ff04703dffdbe8b67a0dc9f592597d7450c1.tar.bz2 |
more AB sync
-rw-r--r-- | kabc/addressbook.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 46a9cf4..64832f1 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -250,7 +250,10 @@ void AddressBook::init(const QString &config, const QString &family ) | |||
250 | con->setGroup( "Resource_sync" ); | 250 | con->setGroup( "Resource_sync" ); |
251 | con->writeEntry( "FileFormat", QString("vcard") ); | ||
252 | con->writeEntry( "FileName", config ); | 251 | con->writeEntry( "FileName", config ); |
252 | con->writeEntry( "FileFormat", QString("vcard") ); | ||
253 | con->writeEntry( "ResourceIdentifier", QString("sync") ); | 253 | con->writeEntry( "ResourceIdentifier", QString("sync") ); |
254 | con->writeEntry( "ResourceName", QString("sync_res") ); | 254 | con->writeEntry( "ResourceName", QString("sync_res") ); |
255 | con->writeEntry( "ResourceType", QString("file") ); | 255 | if ( config.right(4) == ".xml" ) |
256 | con->writeEntry( "ResourceType", QString("qtopia") ); | ||
257 | else | ||
258 | con->writeEntry( "ResourceType", QString("file") ); | ||
256 | //con->sync(); | 259 | //con->sync(); |
@@ -601,2 +604,23 @@ Addressee AddressBook::findByUid( const QString &uid ) | |||
601 | } | 604 | } |
605 | Addressee AddressBook::findByExternUid( const QString& uid , const QString& profile ) | ||
606 | { | ||
607 | Iterator it; | ||
608 | for ( it = begin(); it != end(); ++it ) { | ||
609 | if ( uid == (*it).getID( profile ) ) | ||
610 | return (*it); | ||
611 | } | ||
612 | return Addressee(); | ||
613 | } | ||
614 | void AddressBook::mergeAB( AddressBook *aBook, const QString& profile ) | ||
615 | { | ||
616 | Iterator it; | ||
617 | Addressee ad; | ||
618 | for ( it = begin(); it != end(); ++it ) { | ||
619 | ad = aBook->findByExternUid( (*it).externalUID(), profile ); | ||
620 | if ( !ad.isEmpty() ) { | ||
621 | (*it).mergeContact( ad ); | ||
622 | } | ||
623 | } | ||
624 | } | ||
625 | |||
602 | #if 0 | 626 | #if 0 |