-rw-r--r-- | kaddressbook/kabcore.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 205dbc8..ea34be2 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2727,17 +2727,17 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
2727 | bool syncOK = false; | 2727 | bool syncOK = false; |
2728 | if ( abLocal.load() ) { | 2728 | if ( abLocal.load() ) { |
2729 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); | 2729 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); |
2730 | bool external = false; | 2730 | bool external = false; |
2731 | bool isXML = false; | 2731 | bool isXML = false; |
2732 | if ( filename.right(4) == ".xml") { | 2732 | if ( filename.right(4) == ".xml") { |
2733 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2733 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2734 | isXML = true; | 2734 | isXML = true; |
2735 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); | 2735 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2736 | } else { | 2736 | } else { |
2737 | external = !manager->mIsKapiFile; | 2737 | external = !manager->mIsKapiFile; |
2738 | if ( external ) { | 2738 | if ( external ) { |
2739 | qDebug("Setting vcf mode to external "); | 2739 | qDebug("Setting vcf mode to external "); |
2740 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2740 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2741 | AddressBook::Iterator it; | 2741 | AddressBook::Iterator it; |
2742 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2742 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2743 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 2743 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
@@ -2782,17 +2782,17 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) | |||
2782 | return syncPhone(); | 2782 | return syncPhone(); |
2783 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2783 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2784 | 2784 | ||
2785 | AddressBook abLocal( resource,"syncContact"); | 2785 | AddressBook abLocal( resource,"syncContact"); |
2786 | bool syncOK = false; | 2786 | bool syncOK = false; |
2787 | if ( abLocal.load() ) { | 2787 | if ( abLocal.load() ) { |
2788 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2788 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2789 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2789 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2790 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); | 2790 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
2791 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2791 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2792 | if ( syncOK ) { | 2792 | if ( syncOK ) { |
2793 | if ( syncManager->mWriteBackFile ) { | 2793 | if ( syncManager->mWriteBackFile ) { |
2794 | abLocal.removeSyncAddressees( false ); | 2794 | abLocal.removeSyncAddressees( false ); |
2795 | abLocal.saveAB(); | 2795 | abLocal.saveAB(); |
2796 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2796 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |
2797 | } | 2797 | } |
2798 | } | 2798 | } |
@@ -2824,17 +2824,17 @@ bool KABCore::syncPhone() | |||
2824 | } | 2824 | } |
2825 | AddressBook abLocal( fileName,"syncContact"); | 2825 | AddressBook abLocal( fileName,"syncContact"); |
2826 | bool syncOK = false; | 2826 | bool syncOK = false; |
2827 | { | 2827 | { |
2828 | abLocal.importFromFile( fileName ); | 2828 | abLocal.importFromFile( fileName ); |
2829 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2829 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2830 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2830 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2831 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 2831 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
2832 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); | 2832 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2833 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2833 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2834 | if ( syncOK ) { | 2834 | if ( syncOK ) { |
2835 | if ( syncManager->mWriteBackFile ) { | 2835 | if ( syncManager->mWriteBackFile ) { |
2836 | abLocal.removeSyncAddressees( true ); | 2836 | abLocal.removeSyncAddressees( true ); |
2837 | abLocal.saveABphone( fileName ); | 2837 | abLocal.saveABphone( fileName ); |
2838 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 2838 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
2839 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 2839 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
2840 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2840 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |