summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e8f6132..59aa5a5 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -3177,24 +3177,25 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
3177 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3177 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3178 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 3178 (*it).setID( mCurrentSyncDevice, (*it).uid() );
3179 (*it).computeCsum( mCurrentSyncDevice ); 3179 (*it).computeCsum( mCurrentSyncDevice );
3180 } 3180 }
3181 } 3181 }
3182 } 3182 }
3183 //AddressBook::Iterator it; 3183 //AddressBook::Iterator it;
3184 //QStringList vcards; 3184 //QStringList vcards;
3185 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3185 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3186 // qDebug("Name %s ", (*it).familyName().latin1()); 3186 // qDebug("Name %s ", (*it).familyName().latin1());
3187 //} 3187 //}
3188 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 3188 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
3189 syncManager->hideProgressBar();
3189 if ( syncOK ) { 3190 if ( syncOK ) {
3190 if ( syncManager->mWriteBackFile ) 3191 if ( syncManager->mWriteBackFile )
3191 { 3192 {
3192 if ( external ) 3193 if ( external )
3193 abLocal.removeSyncAddressees( !isXML); 3194 abLocal.removeSyncAddressees( !isXML);
3194 qDebug("KA: Sync::Saving remote AB "); 3195 qDebug("KA: Sync::Saving remote AB ");
3195 if ( ! abLocal.saveAB()) 3196 if ( ! abLocal.saveAB())
3196 qDebug("KA: sync::Error writing back AB to file "); 3197 qDebug("KA: sync::Error writing back AB to file ");
3197 if ( external ) { 3198 if ( external ) {
3198 // afterwrite processing 3199 // afterwrite processing
3199 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); 3200 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML);
3200 } 3201 }
@@ -3228,24 +3229,25 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3228 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3229 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3229 3230
3230 AddressBook abLocal( resource,"syncContact"); 3231 AddressBook abLocal( resource,"syncContact");
3231 bool syncOK = false; 3232 bool syncOK = false;
3232 message(i18n("Loading DTM address data..."), false); 3233 message(i18n("Loading DTM address data..."), false);
3233 if ( abLocal.load() ) { 3234 if ( abLocal.load() ) {
3234 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3235 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3235 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3236 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3236 message(i18n("Sync preprocessing..."),false); 3237 message(i18n("Sync preprocessing..."),false);
3237 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3238 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3238 message(i18n("Synchronizing..."),false); 3239 message(i18n("Synchronizing..."),false);
3239 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3240 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3241 syncManager->hideProgressBar();
3240 if ( syncOK ) { 3242 if ( syncOK ) {
3241 if ( syncManager->mWriteBackFile ) { 3243 if ( syncManager->mWriteBackFile ) {
3242 abLocal.removeSyncAddressees( false ); 3244 abLocal.removeSyncAddressees( false );
3243 message(i18n("Saving DTM address data..."),false); 3245 message(i18n("Saving DTM address data..."),false);
3244 abLocal.saveAB(); 3246 abLocal.saveAB();
3245 message(i18n("Sync postprocessing..."),false); 3247 message(i18n("Sync postprocessing..."),false);
3246 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3248 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3247 } 3249 }
3248 } else 3250 } else
3249 message( i18n("Sync cancelled or failed.") ); 3251 message( i18n("Sync cancelled or failed.") );
3250 setModified(); 3252 setModified();
3251 } 3253 }
@@ -3275,24 +3277,25 @@ bool KABCore::syncPhone()
3275 message(i18n("Phone access failed!")); 3277 message(i18n("Phone access failed!"));
3276 return false; 3278 return false;
3277 } 3279 }
3278 AddressBook abLocal( fileName,"syncContact"); 3280 AddressBook abLocal( fileName,"syncContact");
3279 bool syncOK = false; 3281 bool syncOK = false;
3280 { 3282 {
3281 abLocal.importFromFile( fileName ); 3283 abLocal.importFromFile( fileName );
3282 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3284 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3283 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3285 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3284 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3286 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3285 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3287 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3286 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3288 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3289 syncManager->hideProgressBar();
3287 if ( syncOK ) { 3290 if ( syncOK ) {
3288 if ( syncManager->mWriteBackFile ) { 3291 if ( syncManager->mWriteBackFile ) {
3289 abLocal.removeSyncAddressees( true ); 3292 abLocal.removeSyncAddressees( true );
3290 abLocal.saveABphone( fileName ); 3293 abLocal.saveABphone( fileName );
3291 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3294 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3292 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3295 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3293 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3296 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3294 } 3297 }
3295 } 3298 }
3296 setModified(); 3299 setModified();
3297 } 3300 }
3298 abLocal.removeResources(); 3301 abLocal.removeResources();