summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2005-12-02 09:10:14 (UTC)
committer zautrix <zautrix>2005-12-02 09:10:14 (UTC)
commit64be8d64fc26d1025a24150d065197ba5d608f3d (patch) (unidiff)
tree4f7b0c82641ac591af04f6fdd541b662d4727850 /kabc
parent2bd8aff44e90b6d58e2037771db8b38846addb3e (diff)
downloadkdepimpi-64be8d64fc26d1025a24150d065197ba5d608f3d.zip
kdepimpi-64be8d64fc26d1025a24150d065197ba5d608f3d.tar.gz
kdepimpi-64be8d64fc26d1025a24150d065197ba5d608f3d.tar.bz2
more sync
Diffstat (limited to 'kabc') (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressbook.cpp10
-rw-r--r--kabc/addressbook.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index f3744bc..e04f4b1 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -377,7 +377,7 @@ bool AddressBook::save( Ticket *ticket )
377 return false; 377 return false;
378} 378}
379// exports all Addressees, which are syncable 379// exports all Addressees, which are syncable
380void AddressBook::export2File( QString fileName ) 380void AddressBook::export2File( QString fileName, QString resourceName )
381{ 381{
382 382
383 QFile outFile( fileName ); 383 QFile outFile( fileName );
@@ -392,7 +392,12 @@ void AddressBook::export2File( QString fileName )
392 KABC::VCardConverter::Version version; 392 KABC::VCardConverter::Version version;
393 version = KABC::VCardConverter::v3_0; 393 version = KABC::VCardConverter::v3_0;
394 for ( it = begin(); it != end(); ++it ) { 394 for ( it = begin(); it != end(); ++it ) {
395 if ( (*it).resource() && (*it).resource()->includeInSync() ) { 395 if ( (*it).resource() ) {
396 bool include = (*it).resource()->includeInSync();
397 if ( !resourceName.isEmpty() )
398 include = (resourceName == (*it).resource()->name() );
399 if ( include ) {
400 qDebug(QString ("Exporting resource %1 to file %2").arg( (*it).resource()->name() ).arg( fileName ) );
396 if ( !(*it).IDStr().isEmpty() ) { 401 if ( !(*it).IDStr().isEmpty() ) {
397 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() ); 402 (*it).insertCustom( "KADDRESSBOOK", "X-ExternalID", (*it).IDStr() );
398 } 403 }
@@ -403,6 +408,7 @@ void AddressBook::export2File( QString fileName )
403 t << vcard << "\r\n"; 408 t << vcard << "\r\n";
404 } 409 }
405 } 410 }
411 }
406 t << "\r\n\r\n"; 412 t << "\r\n\r\n";
407 outFile.close(); 413 outFile.close();
408} 414}
diff --git a/kabc/addressbook.h b/kabc/addressbook.h
index 18c03b5..4a0d0a3 100644
--- a/kabc/addressbook.h
+++ b/kabc/addressbook.h
@@ -146,7 +146,7 @@ class AddressBook : public QObject
146 void smplifyAddressees(); 146 void smplifyAddressees();
147 void removeSyncInfo( QString syncProfile); 147 void removeSyncInfo( QString syncProfile);
148 void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); 148 void preparePhoneSync( QString currentSyncDevice, bool isPreSync );
149 void export2File( QString fileName ); 149 void export2File( QString fileName, QString resourceName = "" );
150 bool export2PhoneFormat( QStringList uids ,QString fileName ); 150 bool export2PhoneFormat( QStringList uids ,QString fileName );
151 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); 151 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false );
152 void setUntagged( bool setNonSyncTagged = false ); 152 void setUntagged( bool setNonSyncTagged = false );