author | zautrix <zautrix> | 2004-10-13 14:23:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-13 14:23:28 (UTC) |
commit | 2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6 (patch) (side-by-side diff) | |
tree | f1e664ddf31aae347b1a119c9111cbd1c931bf89 /kabc | |
parent | d41893fb0a49fbb080326a4c1fd98e1a032a182a (diff) | |
download | kdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.zip kdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.tar.gz kdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.tar.bz2 |
more sync fixes
-rw-r--r-- | kabc/addressbook.cpp | 15 | ||||
-rw-r--r-- | kabc/addressbook.h | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 8882259..592d78d 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -376,6 +376,7 @@ bool AddressBook::save( Ticket *ticket ) return false; } +// exports all Addressees, which are syncable void AddressBook::export2File( QString fileName ) { @@ -391,6 +392,7 @@ void AddressBook::export2File( QString fileName ) KABC::VCardConverter::Version version; version = KABC::VCardConverter::v3_0; for ( it = begin(); it != end(); ++it ) { + if ( (*it).resource() && (*it).resource()->includeInSync() ) { if ( !(*it).IDStr().isEmpty() ) { (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); } @@ -400,6 +402,7 @@ void AddressBook::export2File( QString fileName ) converter.addresseeToVCard( *it, vcard, version ); t << vcard << "\r\n"; } + } t << "\r\n\r\n"; outFile.close(); } @@ -419,6 +422,8 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) KABC::Addressee a = ( *it ); if ( a.isEmpty() ) continue; + if ( all && a.resource() && !a.resource()->includeInSync() ) + continue; a.simplifyEmails(); a.simplifyPhoneNumbers(); a.simplifyPhoneNumberTypes(); @@ -476,7 +481,7 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem { if ( removeOld ) - setUntagged(); + setUntagged( true ); KABC::Addressee::List list; QFile file( fileName ); file.open( IO_ReadOnly ); @@ -506,10 +511,16 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem if ( removeOld ) removeUntagged(); } -void AddressBook::setUntagged() +void AddressBook::setUntagged(bool setNonSyncTagged) // = false) { Iterator ait; for ( ait = begin(); ait != end(); ++ait ) { + if ( setNonSyncTagged ) { + if ( (*ait).resource() && ! (*ait).resource()->includeInSync() ) { + (*ait).setTagged( true ); + } else + (*ait).setTagged( false ); + } else (*ait).setTagged( false ); } } diff --git a/kabc/addressbook.h b/kabc/addressbook.h index a6bf451..23bba02 100644 --- a/kabc/addressbook.h +++ b/kabc/addressbook.h @@ -148,7 +148,7 @@ class AddressBook : public QObject void export2File( QString fileName ); bool export2PhoneFormat( QStringList uids ,QString fileName ); void importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); - void setUntagged(); + void setUntagged( bool setNonSyncTagged = false ); void removeUntagged(); void findNewExtIds( QString fileName, QString currentSyncDevice ); /** |