summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 8882259..592d78d 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -377,4 +377,5 @@ bool AddressBook::save( Ticket *ticket )
return false;
}
+// exports all Addressees, which are syncable
void AddressBook::export2File( QString fileName )
{
@@ -392,4 +393,5 @@ void AddressBook::export2File( QString fileName )
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() );
@@ -401,4 +403,5 @@ void AddressBook::export2File( QString fileName )
t << vcard << "\r\n";
}
+ }
t << "\r\n\r\n";
outFile.close();
@@ -420,4 +423,6 @@ bool AddressBook::export2PhoneFormat( QStringList uids ,QString fileName )
if ( a.isEmpty() )
continue;
+ if ( all && a.resource() && !a.resource()->includeInSync() )
+ continue;
a.simplifyEmails();
a.simplifyPhoneNumbers();
@@ -477,5 +482,5 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem
if ( removeOld )
- setUntagged();
+ setUntagged( true );
KABC::Addressee::List list;
QFile file( fileName );
@@ -507,8 +512,14 @@ void AddressBook::importFromFile( QString fileName, bool replaceLabel, bool rem
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 );
}