-rw-r--r-- | kabc/addressbook.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 8882259..592d78d 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -378,2 +378,3 @@ bool AddressBook::save( Ticket *ticket ) } +// exports all Addressees, which are syncable void AddressBook::export2File( QString fileName ) @@ -392,11 +393,13 @@ void AddressBook::export2File( QString fileName ) version = KABC::VCardConverter::v3_0; - for ( it = begin(); it != end(); ++it ) { - if ( !(*it).IDStr().isEmpty() ) { - (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); + for ( it = begin(); it != end(); ++it ) { + if ( (*it).resource() && (*it).resource()->includeInSync() ) { + if ( !(*it).IDStr().isEmpty() ) { + (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); + } + KABC::VCardConverter converter; + QString vcard; + //Resource *resource() const; + converter.addresseeToVCard( *it, vcard, version ); + t << vcard << "\r\n"; } - KABC::VCardConverter converter; - QString vcard; - //Resource *resource() const; - converter.addresseeToVCard( *it, vcard, version ); - t << vcard << "\r\n"; } @@ -417,3 +420,3 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) continue; - } + } KABC::Addressee a = ( *it ); @@ -421,2 +424,4 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName ) continue; + if ( all && a.resource() && !a.resource()->includeInSync() ) + continue; a.simplifyEmails(); @@ -478,3 +483,3 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem if ( removeOld ) - setUntagged(); + setUntagged( true ); KABC::Addressee::List list; @@ -508,3 +513,3 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem } -void AddressBook::setUntagged() +void AddressBook::setUntagged(bool setNonSyncTagged) // = false) { @@ -512,3 +517,9 @@ void AddressBook::setUntagged() for ( ait = begin(); ait != end(); ++ait ) { - (*ait).setTagged( false ); + if ( setNonSyncTagged ) { + if ( (*ait).resource() && ! (*ait).resource()->includeInSync() ) { + (*ait).setTagged( true ); + } else + (*ait).setTagged( false ); + } else + (*ait).setTagged( false ); } |