summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp17
-rw-r--r--libkdepim/ksyncmanager.cpp1
-rw-r--r--libkdepim/ksyncmanager.h1
-rw-r--r--libkdepim/ksyncprefsdialog.cpp14
-rw-r--r--libkdepim/ksyncprefsdialog.h2
-rw-r--r--libkdepim/ksyncprofile.cpp4
-rw-r--r--libkdepim/ksyncprofile.h3
7 files changed, 25 insertions, 17 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 282560f..205dbc8 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2725,40 +2725,25 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
2725 2725
2726 AddressBook abLocal(filename,"syncContact"); 2726 AddressBook abLocal(filename,"syncContact");
2727 bool syncOK = false; 2727 bool syncOK = false;
2728 if ( abLocal.load() ) { 2728 if ( abLocal.load() ) {
2729 qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); 2729 qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode );
2730 bool external = false; 2730 bool external = false;
2731 bool isXML = false; 2731 bool isXML = false;
2732 if ( filename.right(4) == ".xml") { 2732 if ( filename.right(4) == ".xml") {
2733 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2733 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2734 isXML = true; 2734 isXML = true;
2735 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); 2735 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice );
2736 } else { 2736 } else {
2737 Addressee lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2737 external = !manager->mIsKapiFile;
2738 if ( ! lse.isEmpty() ) {
2739 if ( lse.familyName().left(4) == "!E: " )
2740 external = true;
2741 } else {
2742 bool found = false;
2743 AddressBook::Iterator it;
2744 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2745 if ( (*it).revision().date().year() > 2003 ) {
2746 found = true;
2747 break;
2748 }
2749 }
2750 external = ! found;
2751 }
2752
2753 if ( external ) { 2738 if ( external ) {
2754 qDebug("Setting vcf mode to external "); 2739 qDebug("Setting vcf mode to external ");
2755 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2740 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2756 AddressBook::Iterator it; 2741 AddressBook::Iterator it;
2757 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 2742 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2758 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 2743 (*it).setID( mCurrentSyncDevice, (*it).uid() );
2759 (*it).computeCsum( mCurrentSyncDevice ); 2744 (*it).computeCsum( mCurrentSyncDevice );
2760 } 2745 }
2761 } 2746 }
2762 } 2747 }
2763 //AddressBook::Iterator it; 2748 //AddressBook::Iterator it;
2764 //QStringList vcards; 2749 //QStringList vcards;
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 6baa2ee..5175f94 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -171,24 +171,25 @@ void KSyncManager::slotSyncMenu( int action )
171 171
172 mCurrentSyncProfile = action - 1000 ; 172 mCurrentSyncProfile = action - 1000 ;
173 mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; 173 mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ;
174 mCurrentSyncName = mLocalMachineName ; 174 mCurrentSyncName = mLocalMachineName ;
175 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 175 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
176 KSyncProfile* temp = new KSyncProfile (); 176 KSyncProfile* temp = new KSyncProfile ();
177 temp->setName(mSyncProfileNames[mCurrentSyncProfile]); 177 temp->setName(mSyncProfileNames[mCurrentSyncProfile]);
178 temp->readConfig(&config); 178 temp->readConfig(&config);
179 mAskForPreferences = temp->getAskForPreferences(); 179 mAskForPreferences = temp->getAskForPreferences();
180 mSyncAlgoPrefs = temp->getSyncPrefs(); 180 mSyncAlgoPrefs = temp->getSyncPrefs();
181 mWriteBackFile = temp->getWriteBackFile(); 181 mWriteBackFile = temp->getWriteBackFile();
182 mWriteBackExistingOnly = temp->getWriteBackExisting(); 182 mWriteBackExistingOnly = temp->getWriteBackExisting();
183 mIsKapiFile = temp->getIsKapiFile();
183 mWriteBackInFuture = 0; 184 mWriteBackInFuture = 0;
184 if ( temp->getWriteBackFuture() ) 185 if ( temp->getWriteBackFuture() )
185 mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); 186 mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
186 mShowSyncSummary = temp->getShowSummaryAfterSync(); 187 mShowSyncSummary = temp->getShowSummaryAfterSync();
187 if ( action == 1000 ) { 188 if ( action == 1000 ) {
188 syncSharp(); 189 syncSharp();
189 190
190 } else if ( action == 1001 ) { 191 } else if ( action == 1001 ) {
191 syncLocalFile(); 192 syncLocalFile();
192 193
193 } else if ( action == 1002 ) { 194 } else if ( action == 1002 ) {
194 mWriteBackFile = false; 195 mWriteBackFile = false;
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 5b05383..9094aac 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -125,24 +125,25 @@ class KSyncManager : public QObject
125 QString getCurrentSyncName() { return mCurrentSyncName; } 125 QString getCurrentSyncName() { return mCurrentSyncName; }
126 126
127 void showProgressBar(int percentage, QString caption = QString::null, int total=100); 127 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
128 void hideProgressBar(); 128 void hideProgressBar();
129 bool isProgressBarCanceled(); 129 bool isProgressBarCanceled();
130 130
131 // sync stuff 131 // sync stuff
132 QString mLocalMachineName; 132 QString mLocalMachineName;
133 QStringList mExternSyncProfiles; 133 QStringList mExternSyncProfiles;
134 QStringList mSyncProfileNames; 134 QStringList mSyncProfileNames;
135 bool mAskForPreferences; 135 bool mAskForPreferences;
136 bool mShowSyncSummary; 136 bool mShowSyncSummary;
137 bool mIsKapiFile;
137 bool mWriteBackExistingOnly; 138 bool mWriteBackExistingOnly;
138 int mSyncAlgoPrefs; 139 int mSyncAlgoPrefs;
139 bool mWriteBackFile; 140 bool mWriteBackFile;
140 int mWriteBackInFuture; 141 int mWriteBackInFuture;
141 QString mPhoneDevice; 142 QString mPhoneDevice;
142 QString mPhoneConnection; 143 QString mPhoneConnection;
143 QString mPhoneModel; 144 QString mPhoneModel;
144 QString mPassWordPiSync; 145 QString mPassWordPiSync;
145 QString mActiveSyncPort; 146 QString mActiveSyncPort;
146 QString mActiveSyncIP ; 147 QString mActiveSyncIP ;
147 148
148 signals: 149 signals:
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index cf8f996..03265d2 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -233,24 +233,26 @@ void KSyncPrefsDialog::setupSyncAlgTab()
233 temphb = new QHBox( localFileWidget ); 233 temphb = new QHBox( localFileWidget );
234 button = new QPushButton( i18n("Choose..."), temphb ); 234 button = new QPushButton( i18n("Choose..."), temphb );
235 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 235 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
236 button = new QPushButton( i18n("Choose..."), temphb ); 236 button = new QPushButton( i18n("Choose..."), temphb );
237 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 237 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
238 button = new QPushButton( i18n("Choose..."), temphb ); 238 button = new QPushButton( i18n("Choose..."), temphb );
239 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 239 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
240 temphb = new QHBox( localFileWidget ); 240 temphb = new QHBox( localFileWidget );
241 241
242 mRemoteFile = new QLineEdit( temphb); 242 mRemoteFile = new QLineEdit( temphb);
243 mRemoteFileAB = new QLineEdit( temphb); 243 mRemoteFileAB = new QLineEdit( temphb);
244 mRemoteFilePWM = new QLineEdit( temphb); 244 mRemoteFilePWM = new QLineEdit( temphb);
245 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
246
245 247
246 // *** remote 248 // *** remote
247 remoteFileWidget = new QVBox( topFrame); 249 remoteFileWidget = new QVBox( topFrame);
248 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 250 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
249 ++iii; 251 ++iii;
250 temphb = new QHBox( remoteFileWidget ); 252 temphb = new QHBox( remoteFileWidget );
251 new QLabel( i18n("Calendar:"), temphb); 253 new QLabel( i18n("Calendar:"), temphb);
252 new QLabel( i18n("AddressBook:"), temphb); 254 new QLabel( i18n("AddressBook:"), temphb);
253 new QLabel( i18n("PWManager:"), temphb); 255 new QLabel( i18n("PWManager:"), temphb);
254 256
255 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 257 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
256 temphb = new QHBox( remoteFileWidget ); 258 temphb = new QHBox( remoteFileWidget );
@@ -260,25 +262,25 @@ void KSyncPrefsDialog::setupSyncAlgTab()
260 262
261 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 263 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
262 temphb = new QHBox( remoteFileWidget ); 264 temphb = new QHBox( remoteFileWidget );
263 mLocalTempFile = new QLineEdit(temphb); 265 mLocalTempFile = new QLineEdit(temphb);
264 mLocalTempFileAB = new QLineEdit(temphb); 266 mLocalTempFileAB = new QLineEdit(temphb);
265 mLocalTempFilePWM = new QLineEdit(temphb); 267 mLocalTempFilePWM = new QLineEdit(temphb);
266 268
267 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 269 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
268 temphb = new QHBox( remoteFileWidget ); 270 temphb = new QHBox( remoteFileWidget );
269 mRemotePostcommand = new QLineEdit(temphb ); 271 mRemotePostcommand = new QLineEdit(temphb );
270 mRemotePostcommandAB = new QLineEdit(temphb ); 272 mRemotePostcommandAB = new QLineEdit(temphb );
271 mRemotePostcommandPWM = new QLineEdit(temphb ); 273 mRemotePostcommandPWM = new QLineEdit(temphb );
272 274 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
273 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 275 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
274 temphb = new QHBox( remoteFileWidget ); 276 temphb = new QHBox( remoteFileWidget );
275 button = new QPushButton( i18n("ssh/scp"), temphb ); 277 button = new QPushButton( i18n("ssh/scp"), temphb );
276 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 278 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
277 button = new QPushButton( i18n("ftp"), temphb ); 279 button = new QPushButton( i18n("ftp"), temphb );
278 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 280 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
279 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 281 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
280 282
281 // *** pi-sync 283 // *** pi-sync
282 piWidget = new QVBox( topFrame); 284 piWidget = new QVBox( topFrame);
283 topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 285 topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
284 ++iii; 286 ++iii;
@@ -448,24 +450,27 @@ void KSyncPrefsDialog::profileChanged( int item )
448 case 5: 450 case 5:
449 f_rem->setChecked( true); 451 f_rem->setChecked( true);
450 break; 452 break;
451 case 6: 453 case 6:
452 //both->setChecked( true); 454 //both->setChecked( true);
453 break; 455 break;
454 default: 456 default:
455 break; 457 break;
456 } 458 }
457 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 459 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
458 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 460 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
459 mIsPi->setChecked(prof->getIsPiSync()) ; 461 mIsPi->setChecked(prof->getIsPiSync()) ;
462 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
463 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
464
460 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); 465 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() );
461 proGr->setEnabled( item > 2 ); 466 proGr->setEnabled( item > 2 );
462 if ( item < 3 ) { 467 if ( item < 3 ) {
463 localFileWidget->hide(); 468 localFileWidget->hide();
464 remoteFileWidget->hide(); 469 remoteFileWidget->hide();
465 phoneWidget->hide(); 470 phoneWidget->hide();
466 piWidget->hide(); 471 piWidget->hide();
467 472
468 } else 473 } else
469 kindChanged( prof->getIsLocalFileSync() ); 474 kindChanged( prof->getIsLocalFileSync() );
470} 475}
471 476
@@ -488,24 +493,30 @@ void KSyncPrefsDialog::fillFTP()
488 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 493 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
489 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 494 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
490 mLocalTempFileAB->setText("/tmp/std.vcf" ); 495 mLocalTempFileAB->setText("/tmp/std.vcf" );
491 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 496 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
492 497
493 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 498 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
494 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 499 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
495 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 500 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
496 501
497} 502}
498void KSyncPrefsDialog::kindChanged( bool b ) 503void KSyncPrefsDialog::kindChanged( bool b )
499{ 504{
505
506 if ( mIsLocal->isChecked () ) {
507 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() );
508 } else {
509 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() );
510 }
500 511
501 if ( mIsLocal->isChecked () ) 512 if ( mIsLocal->isChecked () )
502 localFileWidget->show(); 513 localFileWidget->show();
503 else 514 else
504 localFileWidget->hide(); 515 localFileWidget->hide();
505 516
506 if ( mIsNotLocal->isChecked () ) 517 if ( mIsNotLocal->isChecked () )
507 remoteFileWidget->show(); 518 remoteFileWidget->show();
508 else 519 else
509 remoteFileWidget->hide(); 520 remoteFileWidget->hide();
510 521
511 if ( mIsPhone->isChecked () ) { 522 if ( mIsPhone->isChecked () ) {
@@ -570,24 +581,25 @@ void KSyncPrefsDialog::saveProfile()
570 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 581 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
571 prof->setAskForPreferences( mAskForPreferences->isChecked()); 582 prof->setAskForPreferences( mAskForPreferences->isChecked());
572 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 583 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
573 prof->setWriteBackFile( mWriteBackFile->isChecked()); 584 prof->setWriteBackFile( mWriteBackFile->isChecked());
574 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 585 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
575 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 586 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
576 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 587 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
577 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 588 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
578 prof->setSyncPrefs( syncprefs); 589 prof->setSyncPrefs( syncprefs);
579 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 590 prof->setIsLocalFileSync( mIsLocal->isChecked() );
580 prof->setIsPhoneSync( mIsPhone->isChecked() ); 591 prof->setIsPhoneSync( mIsPhone->isChecked() );
581 prof->setIsPiSync( mIsPi->isChecked() ); 592 prof->setIsPiSync( mIsPi->isChecked() );
593 prof->setIsKapiFile( mIsKapiFileL->isChecked() );
582 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 594 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
583 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 595 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
584 if ( mWriteContactToSIM ) 596 if ( mWriteContactToSIM )
585 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 597 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
586 prof->setPhoneDevice( mPhoneDevice->text() ); 598 prof->setPhoneDevice( mPhoneDevice->text() );
587 prof->setPhoneConnection( mPhoneConnection->text() ); 599 prof->setPhoneConnection( mPhoneConnection->text() );
588 prof->setPhoneModel( mPhoneModel->text() ); 600 prof->setPhoneModel( mPhoneModel->text() );
589 601
590 } 602 }
591 603
592} 604}
593 605
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index d3f8f4c..c601a58 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -137,15 +137,17 @@ class KSyncPrefsDialog : public KDialog
137 QWidget* mSetupSyncAlgTab; 137 QWidget* mSetupSyncAlgTab;
138 QVBox* localFileWidget; 138 QVBox* localFileWidget;
139 QVBox* remoteFileWidget; 139 QVBox* remoteFileWidget;
140 QVBox* phoneWidget; 140 QVBox* phoneWidget;
141 QVBox* piWidget; 141 QVBox* piWidget;
142 QCheckBox* mWriteBackFile; 142 QCheckBox* mWriteBackFile;
143 QCheckBox* mWriteBackFuture; 143 QCheckBox* mWriteBackFuture;
144 QSpinBox* mWriteBackFutureWeeks; 144 QSpinBox* mWriteBackFutureWeeks;
145 QCheckBox* mWriteBackExisting; 145 QCheckBox* mWriteBackExisting;
146 QCheckBox* mAskForPreferences; 146 QCheckBox* mAskForPreferences;
147 QCheckBox* mShowSummaryAfterSync; 147 QCheckBox* mShowSummaryAfterSync;
148 QCheckBox* mWriteContactToSIM; 148 QCheckBox* mWriteContactToSIM;
149 QCheckBox* mIsKapiFileL;
150 QCheckBox* mIsKapiFileR;
149}; 151};
150 152
151#endif 153#endif
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 76dfe00..029b70b 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -67,24 +67,25 @@ KSyncProfile* KSyncProfile::clone()
67 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 67 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
68 myClone->setAskForPreferences( mAskForPreferences); 68 myClone->setAskForPreferences( mAskForPreferences);
69 myClone->setWriteBackExisting(mWriteBackExisting ); 69 myClone->setWriteBackExisting(mWriteBackExisting );
70 myClone->setWriteBackFile( mWriteBackFile); 70 myClone->setWriteBackFile( mWriteBackFile);
71 myClone->setWriteBackFuture( mWriteBackFuture ); 71 myClone->setWriteBackFuture( mWriteBackFuture );
72 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 72 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
73 myClone->setIncludeInRingSync( mIncludeInRingSync ); 73 myClone->setIncludeInRingSync( mIncludeInRingSync );
74 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 74 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
75 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); 75 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
76 myClone->setSyncPrefs( mSyncPrefs); 76 myClone->setSyncPrefs( mSyncPrefs);
77 myClone->setIsLocalFileSync( mIsLocalFileSync ); 77 myClone->setIsLocalFileSync( mIsLocalFileSync );
78 myClone->setIsPhoneSync( mIsPhoneSync ); 78 myClone->setIsPhoneSync( mIsPhoneSync );
79 myClone->setIsKapiFile( mIsKapiFile );
79 myClone->setIsPiSync( mIsPiSync ); 80 myClone->setIsPiSync( mIsPiSync );
80 myClone->setWriteContactToSIM( mWriteContactToSIM ); 81 myClone->setWriteContactToSIM( mWriteContactToSIM );
81 myClone->setName( "noName" ); 82 myClone->setName( "noName" );
82 //myClone->setIdentifier( "noID" ); 83 //myClone->setIdentifier( "noID" );
83 return myClone; 84 return myClone;
84} 85}
85 86
86 87
87void KSyncProfile::setDefault() 88void KSyncProfile::setDefault()
88{ 89{
89 mPreSyncCommand = i18n("command for downloading remote file to local device"); 90 mPreSyncCommand = i18n("command for downloading remote file to local device");
90 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 91 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
@@ -116,24 +117,25 @@ void KSyncProfile::setDefault()
116 mWriteBackExisting = false; 117 mWriteBackExisting = false;
117 mWriteBackFuture = false; 118 mWriteBackFuture = false;
118 mWriteBackFutureWeeks = 12; 119 mWriteBackFutureWeeks = 12;
119 mWriteBackFile = true; 120 mWriteBackFile = true;
120 mIncludeInRingSync = false; 121 mIncludeInRingSync = false;
121 mIncludeInRingSyncAB = false; 122 mIncludeInRingSyncAB = false;
122 mIncludeInRingSyncPWM = false; 123 mIncludeInRingSyncPWM = false;
123 mSyncPrefs = SYNC_PREF_ASK; 124 mSyncPrefs = SYNC_PREF_ASK;
124 mIsLocalFileSync = true; 125 mIsLocalFileSync = true;
125 mName = "noName"; 126 mName = "noName";
126 mIsPhoneSync = false; 127 mIsPhoneSync = false;
127 mIsPiSync = false; 128 mIsPiSync = false;
129 mIsKapiFile = false;
128 mWriteContactToSIM = false; 130 mWriteContactToSIM = false;
129 mPhoneDevice = "/dev/ircomm"; 131 mPhoneDevice = "/dev/ircomm";
130 mPhoneConnection = "irda"; 132 mPhoneConnection = "irda";
131 mPhoneModel = "6310i"; 133 mPhoneModel = "6310i";
132} 134}
133void KSyncProfile::readConfig(KConfig *config ) 135void KSyncProfile::readConfig(KConfig *config )
134{ 136{
135 if (config) 137 if (config)
136 { 138 {
137 139
138 config->setGroup( mName ); 140 config->setGroup( mName );
139 141
@@ -173,24 +175,25 @@ void KSyncProfile::readConfig(KConfig *config )
173 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 175 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
174 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 176 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
175 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 177 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
176 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 178 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
177 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 179 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
178 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 180 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
179 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 181 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
180 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 182 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
181 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 183 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
182 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 184 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
183 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); 185 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
184 mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); 186 mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
187 mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile );
185 } 188 }
186 else 189 else
187 { 190 {
188 setDefault(); 191 setDefault();
189 } 192 }
190} 193}
191 194
192void KSyncProfile::deleteConfig(KConfig *config ) 195void KSyncProfile::deleteConfig(KConfig *config )
193{ 196{
194 config->deleteGroup( mName ); 197 config->deleteGroup( mName );
195} 198}
196 199
@@ -235,14 +238,15 @@ void KSyncProfile::writeConfig( KConfig * config )
235 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 238 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
236 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 239 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
237 config->writeEntry( "AskForPreferences",mAskForPreferences ); 240 config->writeEntry( "AskForPreferences",mAskForPreferences );
238 config->writeEntry( "WriteBackExisting",mWriteBackExisting ); 241 config->writeEntry( "WriteBackExisting",mWriteBackExisting );
239 config->writeEntry( "WriteBackFuture",mWriteBackFuture ); 242 config->writeEntry( "WriteBackFuture",mWriteBackFuture );
240 config->writeEntry( "WriteBackFile",mWriteBackFile ); 243 config->writeEntry( "WriteBackFile",mWriteBackFile );
241 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); 244 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
242 config->writeEntry( "SyncPrefs", mSyncPrefs ); 245 config->writeEntry( "SyncPrefs", mSyncPrefs );
243 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); 246 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
244 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); 247 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
245 config->writeEntry( "IsPhoneSync", mIsPhoneSync ); 248 config->writeEntry( "IsPhoneSync", mIsPhoneSync );
246 config->writeEntry( "IsPiSync", mIsPiSync ); 249 config->writeEntry( "IsPiSync", mIsPiSync );
250 config->writeEntry( "IsKapiFile", mIsKapiFile );
247} 251}
248 252
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 6a68bd7..0a59111 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -125,24 +125,26 @@ class KSyncProfile : public QObject {
125 void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;} 125 void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;}
126 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;} 126 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;}
127 void setSyncPrefs( int n ) { mSyncPrefs= n;} 127 void setSyncPrefs( int n ) { mSyncPrefs= n;}
128 int getSyncPrefs( ) { return mSyncPrefs;} 128 int getSyncPrefs( ) { return mSyncPrefs;}
129 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} 129 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
130 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} 130 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
131 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} 131 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
132 bool getIsLocalFileSync( ) { return mIsLocalFileSync;} 132 bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
133 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} 133 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
134 bool getIsPhoneSync( ) { return mIsPhoneSync;} 134 bool getIsPhoneSync( ) { return mIsPhoneSync;}
135 void setIsPiSync( bool b ) { mIsPiSync= b;} 135 void setIsPiSync( bool b ) { mIsPiSync= b;}
136 bool getIsPiSync( ) { return mIsPiSync;} 136 bool getIsPiSync( ) { return mIsPiSync;}
137 void setIsKapiFile( bool b ) { mIsKapiFile= b;}
138 bool getIsKapiFile( ) { return mIsKapiFile;}
137 private: 139 private:
138 QString mName; 140 QString mName;
139 QString mPreSyncCommand; 141 QString mPreSyncCommand;
140 QString mPostSyncCommand; 142 QString mPostSyncCommand;
141 QString mLocalTempFile; 143 QString mLocalTempFile;
142 QString mRemoteFileName; 144 QString mRemoteFileName;
143 QString mPreSyncCommandAB; 145 QString mPreSyncCommandAB;
144 QString mPostSyncCommandAB; 146 QString mPostSyncCommandAB;
145 QString mLocalTempFileAB; 147 QString mLocalTempFileAB;
146 QString mRemoteFileNameAB; 148 QString mRemoteFileNameAB;
147 QString mPreSyncCommandPWM; 149 QString mPreSyncCommandPWM;
148 QString mPostSyncCommandPWM; 150 QString mPostSyncCommandPWM;
@@ -171,15 +173,16 @@ class KSyncProfile : public QObject {
171 int mSyncPrefs; 173 int mSyncPrefs;
172 bool mWriteBackFile; 174 bool mWriteBackFile;
173 bool mWriteBackExisting; 175 bool mWriteBackExisting;
174 bool mWriteBackFuture; 176 bool mWriteBackFuture;
175 int mWriteBackFutureWeeks; 177 int mWriteBackFutureWeeks;
176 bool mAskForPreferences; 178 bool mAskForPreferences;
177 bool mShowSummaryAfterSync; 179 bool mShowSummaryAfterSync;
178 bool mIsLocalFileSync; 180 bool mIsLocalFileSync;
179 bool mIsPhoneSync; 181 bool mIsPhoneSync;
180 bool mWriteContactToSIM; 182 bool mWriteContactToSIM;
181 183
182 bool mIsPiSync; 184 bool mIsPiSync;
185 bool mIsKapiFile;
183}; 186};
184 187
185#endif 188#endif