summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
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
@@ -182,16 +182,17 @@ void KSyncManager::slotClearMenu( int action )
182 return; 182 return;
183 mImplementation->removeSyncInfo( syncDevice ); 183 mImplementation->removeSyncInfo( syncDevice );
184} 184}
185void KSyncManager::slotSyncMenu( int action ) 185void KSyncManager::slotSyncMenu( int action )
186{ 186{
187 qDebug("syncaction %d ", action); 187 qDebug("syncaction %d ", action);
188 if ( action == 5000 ) 188 if ( action == 5000 )
189 return; 189 return;
190 mSyncWithDesktop = false;
190 if ( action == 0 ) { 191 if ( action == 0 ) {
191 192
192 // seems to be a Qt2 event handling bug 193 // seems to be a Qt2 event handling bug
193 // syncmenu.clear causes a segfault at first time 194 // syncmenu.clear causes a segfault at first time
194 // when we call it after the main event loop, it is ok 195 // when we call it after the main event loop, it is ok
195 // same behaviour when calling OM/Pi via QCOP for the first time 196 // same behaviour when calling OM/Pi via QCOP for the first time
196 QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); 197 QTimer::singleShot ( 1, this, SLOT ( confSync() ) );
197 //confSync(); 198 //confSync();
@@ -246,16 +247,17 @@ void KSyncManager::slotSyncMenu( int action )
246 } 247 }
247 mWriteBackExistingOnly = temp->getWriteBackExisting(); 248 mWriteBackExistingOnly = temp->getWriteBackExisting();
248 mIsKapiFile = temp->getIsKapiFile(); 249 mIsKapiFile = temp->getIsKapiFile();
249 mWriteBackInFuture = 0; 250 mWriteBackInFuture = 0;
250 if ( temp->getWriteBackFuture() ) 251 if ( temp->getWriteBackFuture() )
251 mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); 252 mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
252 253
253 if ( action == 1000 ) { 254 if ( action == 1000 ) {
255 mIsKapiFile = false;
254#ifdef DESKTOP_VERSION 256#ifdef DESKTOP_VERSION
255 syncKDE(); 257 syncKDE();
256#else 258#else
257 syncSharp(); 259 syncSharp();
258#endif 260#endif
259 261
260 } else if ( action == 1001 ) { 262 } else if ( action == 1001 ) {
261 syncLocalFile(); 263 syncLocalFile();
@@ -877,21 +879,39 @@ void KSyncManager::confSync()
877 for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { 879 for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) {
878 if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) 880 if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) )
879 mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); 881 mImplementation->removeSyncInfo( oldSyncProfileNames[ii] );
880 } 882 }
881 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 883 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
882} 884}
883void KSyncManager::syncKDE() 885void KSyncManager::syncKDE()
884{ 886{
887 mSyncWithDesktop = true;
885 emit save(); 888 emit save();
886 switch(mTargetApp) 889 switch(mTargetApp)
887 { 890 {
888 case (KAPI): 891 case (KAPI):
889 892 {
893#ifdef DESKTOP_VERSION
894 QString command = qApp->applicationDirPath () + "/kdeabdump";
895#else
896 QString command = "kdeabdump";
897#endif
898 if ( ! QFile::exists ( command ) )
899 command = "kdeabdump";
900 QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf";
901 system ( command.latin1());
902 if ( syncWithFile( fileName,true ) ) {
903 if ( mWriteBackFile ) {
904 command += " --read";
905 system ( command.latin1());
906 }
907 }
908
909 }
890 break; 910 break;
891 case (KOPI): 911 case (KOPI):
892 { 912 {
893#ifdef DESKTOP_VERSION 913#ifdef DESKTOP_VERSION
894 QString command = qApp->applicationDirPath () + "/kdecaldump"; 914 QString command = qApp->applicationDirPath () + "/kdecaldump";
895#else 915#else
896 QString command = "kdecaldump"; 916 QString command = "kdecaldump";
897#endif 917#endif
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 2af891b..6da0ee4 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -117,16 +117,17 @@ class KSyncManager : public QObject
117 void multiSync( bool askforPrefs ); 117 void multiSync( bool askforPrefs );
118 bool blockSave() { return mBlockSaveFlag; } 118 bool blockSave() { return mBlockSaveFlag; }
119 void setBlockSave(bool sa) { mBlockSaveFlag = sa; } 119 void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
120 void setDefaultFileName( QString s) { mDefFileName = s ;} 120 void setDefaultFileName( QString s) { mDefFileName = s ;}
121 QString defaultFileName() { return mDefFileName ;} 121 QString defaultFileName() { return mDefFileName ;}
122 QString syncFileName(); 122 QString syncFileName();
123 void enableQuick( bool ask = true); 123 void enableQuick( bool ask = true);
124 124
125 bool syncWithDesktop () { return mSyncWithDesktop;}
125 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 126 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
126 QString getCurrentSyncName() { return mCurrentSyncName; } 127 QString getCurrentSyncName() { return mCurrentSyncName; }
127 128
128 void showProgressBar(int percentage, QString caption = QString::null, int total=100); 129 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
129 void hideProgressBar(); 130 void hideProgressBar();
130 bool isProgressBarCanceled(); 131 bool isProgressBarCanceled();
131 132
132 // sync stuff 133 // sync stuff
@@ -182,16 +183,17 @@ class KSyncManager : public QObject
182 QString getPassword( ); 183 QString getPassword( );
183 bool mPisyncFinished; 184 bool mPisyncFinished;
184 bool mBlockSaveFlag; 185 bool mBlockSaveFlag;
185 QWidget* mParent; 186 QWidget* mParent;
186 KSyncInterface* mImplementation; 187 KSyncInterface* mImplementation;
187 TargetApp mTargetApp; 188 TargetApp mTargetApp;
188 QPopupMenu* mSyncMenu; 189 QPopupMenu* mSyncMenu;
189 QProgressBar* bar; 190 QProgressBar* bar;
191 bool mSyncWithDesktop;
190 192
191private slots: 193private slots:
192 void confSync(); 194 void confSync();
193 195
194 196
195}; 197};
196 198
197 199