-rw-r--r-- | kaddressbook/kabcore.cpp | 27 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 7 |
2 files changed, 29 insertions, 5 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index f8683e7..c1ead9d 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -3026,11 +3026,34 @@ void KABCore::confSync() | |||
3026 | } | 3026 | } |
3027 | void KABCore::syncSharp() | 3027 | void KABCore::syncSharp() |
3028 | { | 3028 | { |
3029 | if ( ! syncExternal("sharp") ) | ||
3030 | qDebug("ERROR sync sharp ");; | ||
3031 | } | ||
3032 | bool KABCore::syncExternal(QString resource) | ||
3033 | { | ||
3029 | if ( mModified ) | 3034 | if ( mModified ) |
3030 | save(); | 3035 | save(); |
3031 | qDebug("pending syncSharp() "); | 3036 | if ( KABPrefs::instance()->mAskForPreferences ) |
3032 | //mView->syncSharp(); | 3037 | edit_sync_options(); |
3038 | qDebug("syncSharp() "); | ||
3039 | AddressBook abLocal( resource,"syncContact"); | ||
3040 | bool syncOK = false; | ||
3041 | if ( abLocal.load() ) { | ||
3042 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | ||
3043 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | ||
3044 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); | ||
3045 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, KABPrefs::instance()->mSyncAlgoPrefs ); | ||
3046 | if ( syncOK ) { | ||
3047 | if ( KABPrefs::instance()->mWriteBackFile ) { | ||
3048 | abLocal.saveAB(); | ||
3049 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | ||
3050 | } | ||
3051 | } | ||
3033 | setModified(); | 3052 | setModified(); |
3053 | } | ||
3054 | if ( syncOK ) | ||
3055 | mViewManager->refreshView(); | ||
3056 | return syncOK; | ||
3034 | 3057 | ||
3035 | } | 3058 | } |
3036 | void KABCore::syncPhone() | 3059 | void KABCore::syncPhone() |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index f01f306..e89bf41 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -460,9 +460,10 @@ class KABCore : public QWidget | |||
460 | QString mCurrentSyncName; | 460 | QString mCurrentSyncName; |
461 | void quickSyncLocalFile(); | 461 | void quickSyncLocalFile(); |
462 | bool syncWithFile( QString fn , bool quick ); | 462 | bool syncWithFile( QString fn , bool quick ); |
463 | void KABCore::syncLocalFile(); | 463 | void syncLocalFile(); |
464 | void KABCore::syncPhone(); | 464 | void syncPhone(); |
465 | void KABCore::syncSharp(); | 465 | void syncSharp(); |
466 | bool syncExternal(QString); | ||
466 | void multiSync( bool askforPrefs ); | 467 | void multiSync( bool askforPrefs ); |
467 | int mCurrentSyncProfile ; | 468 | int mCurrentSyncProfile ; |
468 | void syncRemote( KSyncProfile* prof, bool ask = true); | 469 | void syncRemote( KSyncProfile* prof, bool ask = true); |