summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp20
1 files changed, 20 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
@@ -186,8 +186,9 @@ void KSyncManager::slotSyncMenu( int action )
{
qDebug("syncaction %d ", action);
if ( action == 5000 )
return;
+ mSyncWithDesktop = false;
if ( action == 0 ) {
// seems to be a Qt2 event handling bug
// syncmenu.clear causes a segfault at first time
@@ -250,8 +251,9 @@ void KSyncManager::slotSyncMenu( int action )
if ( temp->getWriteBackFuture() )
mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
if ( action == 1000 ) {
+ mIsKapiFile = false;
#ifdef DESKTOP_VERSION
syncKDE();
#else
syncSharp();
@@ -881,13 +883,31 @@ void KSyncManager::confSync()
QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
}
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):
{
#ifdef DESKTOP_VERSION