summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2004-10-27 12:27:39 (UTC)
committer zautrix <zautrix>2004-10-27 12:27:39 (UTC)
commit2f3396d84d2f3c92e1e0e420d677892c1f9c0778 (patch) (side-by-side diff)
tree1ebab5dc6d00cb09720789897ce2c86df05cc9ab /libkdepim
parentf73d249579d52d7aeaacde2dcb23abeb42f9ee95 (diff)
downloadkdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.zip
kdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.tar.gz
kdepimpi-2f3396d84d2f3c92e1e0e420d677892c1f9c0778.tar.bz2
completed KDE AB sync. but will it work ...?
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp22
-rw-r--r--libkdepim/ksyncmanager.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index e09050e..17e6c75 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -187,6 +187,7 @@ 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
@@ -251,6 +252,7 @@ void KSyncManager::slotSyncMenu( int action )
mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
if ( action == 1000 ) {
+ mIsKapiFile = false;
#ifdef DESKTOP_VERSION
syncKDE();
#else
@@ -882,11 +884,29 @@ 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
@@ -122,6 +122,7 @@ class KSyncManager : public QObject
QString syncFileName();
void enableQuick( bool ask = true);
+ bool syncWithDesktop () { return mSyncWithDesktop;}
QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
QString getCurrentSyncName() { return mCurrentSyncName; }
@@ -187,6 +188,7 @@ class KSyncManager : public QObject
TargetApp mTargetApp;
QPopupMenu* mSyncMenu;
QProgressBar* bar;
+ bool mSyncWithDesktop;
private slots:
void confSync();