summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp63
-rw-r--r--libkdepim/ksyncmanager.h4
2 files changed, 48 insertions, 19 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 7ca3ee0..554c6e5 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -183,2 +183,8 @@ void KSyncManager::slotSyncMenu( int action )
183 setBlockSave(true); 183 setBlockSave(true);
184 bool silent = false;
185 if ( action == 999 ) {
186 //special mode for silent syncing
187 action = 1000;
188 silent = true;
189 }
184 190
@@ -191,5 +197,14 @@ void KSyncManager::slotSyncMenu( int action )
191 temp->readConfig(&config); 197 temp->readConfig(&config);
192 mAskForPreferences = temp->getAskForPreferences(); 198 if (silent) {
193 mSyncAlgoPrefs = temp->getSyncPrefs(); 199 mAskForPreferences = false;
194 mWriteBackFile = temp->getWriteBackFile(); 200 mShowSyncSummary = false;
201 mWriteBackFile = true;
202 mSyncAlgoPrefs = 2;// take newest
203 }
204 else {
205 mAskForPreferences = temp->getAskForPreferences();
206 mShowSyncSummary = temp->getShowSummaryAfterSync();
207 mWriteBackFile = temp->getWriteBackFile();
208 mSyncAlgoPrefs = temp->getSyncPrefs();
209 }
195 mWriteBackExistingOnly = temp->getWriteBackExisting(); 210 mWriteBackExistingOnly = temp->getWriteBackExisting();
@@ -199,3 +214,3 @@ void KSyncManager::slotSyncMenu( int action )
199 mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); 214 mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
200 mShowSyncSummary = temp->getShowSummaryAfterSync(); 215
201 if ( action == 1000 ) { 216 if ( action == 1000 ) {
@@ -304,2 +319,3 @@ void KSyncManager::enableQuick( bool ask )
304#else 319#else
320 mPrefs->mPassiveSyncWithDesktop = false;
305 QCheckBox syncdesktop( i18n("Automatically sync\nwith KDE-Desktop"),&dia ); 321 QCheckBox syncdesktop( i18n("Automatically sync\nwith KDE-Desktop"),&dia );
@@ -418,3 +434,6 @@ bool KSyncManager::syncWithFile( QString fn , bool quick )
418 if ( mAskForPreferences ) 434 if ( mAskForPreferences )
419 edit_sync_options(); 435 if ( !edit_sync_options()) {
436 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
437 return false;
438 }
420 if ( result == 0 ) { 439 if ( result == 0 ) {
@@ -457,3 +476,6 @@ void KSyncManager::multiSync( bool askforPrefs )
457 if ( askforPrefs ) { 476 if ( askforPrefs ) {
458 edit_sync_options(); 477 if ( !edit_sync_options()) {
478 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
479 return;
480 }
459 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; 481 mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs;
@@ -689,3 +711,3 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask)
689} 711}
690void KSyncManager::edit_pisync_options() 712bool KSyncManager::edit_pisync_options()
691{ 713{
@@ -718,6 +740,7 @@ void KSyncManager::edit_pisync_options()
718 mActiveSyncIP = le2.text(); 740 mActiveSyncIP = le2.text();
741 return true;
719 } 742 }
720 743 return false;
721} 744}
722void KSyncManager::edit_sync_options() 745bool KSyncManager::edit_sync_options()
723{ 746{
@@ -768,5 +791,5 @@ void KSyncManager::edit_sync_options()
768 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; 791 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ;
792 return true;
769 } 793 }
770 794 return false;
771
772} 795}
@@ -866,4 +889,7 @@ bool KSyncManager::syncExternalApplication(QString resource)
866 889
867 if ( mAskForPreferences ) 890 if ( mAskForPreferences )
868 edit_sync_options(); 891 if ( !edit_sync_options()) {
892 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
893 return false;
894 }
869 895
@@ -937,3 +963,6 @@ void KSyncManager::syncPi()
937 if ( mAskForPreferences ) 963 if ( mAskForPreferences )
938 edit_pisync_options(); 964 if ( !edit_pisync_options()) {
965 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
966 return;
967 }
939 bool ok; 968 bool ok;
@@ -1168,7 +1197,7 @@ void KServerSocket::readBackFileFromSocket()
1168 file.close(); 1197 file.close();
1198 piFileString = "";
1199 emit file_received( true );
1169 delete mSyncActionDialog; 1200 delete mSyncActionDialog;
1170 mSyncActionDialog = 0; 1201 mSyncActionDialog = 0;
1171 piFileString = "";
1172 blockRC = false; 1202 blockRC = false;
1173 emit file_received( true );
1174 1203
@@ -1201,3 +1230,3 @@ void KCommandSocket::readFile( QString fn )
1201 os << "GET " << mPassWord << "\r\n"; 1230 os << "GET " << mPassWord << "\r\n";
1202 mTimerSocket->start( 10000 ); 1231 mTimerSocket->start( 20000 );
1203} 1232}
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 7b9c499..4a610fa 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -176,4 +176,4 @@ class KSyncManager : public QObject
176 void syncRemote( KSyncProfile* prof, bool ask = true); 176 void syncRemote( KSyncProfile* prof, bool ask = true);
177 void edit_sync_options(); 177 bool edit_sync_options();
178 void edit_pisync_options(); 178 bool edit_pisync_options();
179 int ringSync(); 179 int ringSync();