summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
authorzautrix <zautrix>2004-09-20 19:27:24 (UTC)
committer zautrix <zautrix>2004-09-20 19:27:24 (UTC)
commited49c55dac215ac2ed9286ebfc36e5a19417f0bb (patch) (side-by-side diff)
tree79f933ed5d4a9a9df524dbd71d41d12dde007401 /kaddressbook/kabcore.cpp
parent138be6cfa921cd8a07fa0b18046d955e7d2dbd6e (diff)
downloadkdepimpi-ed49c55dac215ac2ed9286ebfc36e5a19417f0bb.zip
kdepimpi-ed49c55dac215ac2ed9286ebfc36e5a19417f0bb.tar.gz
kdepimpi-ed49c55dac215ac2ed9286ebfc36e5a19417f0bb.tar.bz2
more DTM sync
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp29
1 files changed, 26 insertions, 3 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()
}
void KABCore::syncSharp()
{
+ if ( ! syncExternal("sharp") )
+ qDebug("ERROR sync sharp ");;
+}
+bool KABCore::syncExternal(QString resource)
+{
if ( mModified )
save();
- qDebug("pending syncSharp() ");
- //mView->syncSharp();
- setModified();
+ if ( KABPrefs::instance()->mAskForPreferences )
+ edit_sync_options();
+ qDebug("syncSharp() ");
+ AddressBook abLocal( resource,"syncContact");
+ bool syncOK = false;
+ if ( abLocal.load() ) {
+ qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
+ mGlobalSyncMode = SYNC_MODE_EXTERNAL;
+ abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice );
+ syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, KABPrefs::instance()->mSyncAlgoPrefs );
+ if ( syncOK ) {
+ if ( KABPrefs::instance()->mWriteBackFile ) {
+ abLocal.saveAB();
+ abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
+ }
+ }
+ setModified();
+ }
+ if ( syncOK )
+ mViewManager->refreshView();
+ return syncOK;
}
void KABCore::syncPhone()