-rw-r--r-- | libkdepim/ksyncmanager.cpp | 20 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index e09050e..17e6c75 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -188,4 +188,5 @@ void KSyncManager::slotSyncMenu( int action ) if ( action == 5000 ) return; + mSyncWithDesktop = false; if ( action == 0 ) { @@ -252,4 +253,5 @@ void KSyncManager::slotSyncMenu( int action ) if ( action == 1000 ) { + mIsKapiFile = false; #ifdef DESKTOP_VERSION syncKDE(); @@ -883,9 +885,27 @@ void KSyncManager::confSync() void KSyncManager::syncKDE() { + mSyncWithDesktop = true; emit save(); switch(mTargetApp) { case (KAPI): + { +#ifdef DESKTOP_VERSION + QString command = qApp->applicationDirPath () + "/kdeabdump"; +#else + QString command = "kdeabdump"; +#endif + if ( ! QFile::exists ( command ) ) + command = "kdeabdump"; + QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; + system ( command.latin1()); + if ( syncWithFile( fileName,true ) ) { + if ( mWriteBackFile ) { + command += " --read"; + system ( command.latin1()); + } + } + } break; case (KOPI): diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 2af891b..6da0ee4 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -123,4 +123,5 @@ class KSyncManager : public QObject void enableQuick( bool ask = true); + bool syncWithDesktop () { return mSyncWithDesktop;} QString getCurrentSyncDevice() { return mCurrentSyncDevice; } QString getCurrentSyncName() { return mCurrentSyncName; } @@ -188,4 +189,5 @@ class KSyncManager : public QObject QPopupMenu* mSyncMenu; QProgressBar* bar; + bool mSyncWithDesktop; private slots: |