summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-13 03:05:35 (UTC)
committer zautrix <zautrix>2004-10-13 03:05:35 (UTC)
commit8f852fddc2dc5b63511d6ad1c85a1e74141969ff (patch) (side-by-side diff)
tree123c7e845e1520a4dcd50dd2361252cc6ab7a76a
parente7833b80c28e38bfe6316ee5fce150635cdebe03 (diff)
downloadkdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.zip
kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.gz
kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.bz2
fixed one syncing problem
Diffstat (more/less context) (show 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
@@ -2705,80 +2705,65 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
remote->insertAddressee( addresseeRSync, false );
local->insertAddressee( addresseeLSync, false );
QString mes;
mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR );
if ( syncManager->mShowSyncSummary ) {
KMessageBox::information(this, mes, i18n("KA/Pi Synchronization") );
}
qDebug( mes );
return syncOK;
}
//this is a overwritten callbackmethods from the syncinterface
bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
{
//pending prepare addresseeview for output
//pending detect, if remote file has REV field. if not switch to external sync
mGlobalSyncMode = SYNC_MODE_NORMAL;
QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
AddressBook abLocal(filename,"syncContact");
bool syncOK = false;
if ( abLocal.load() ) {
qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode );
bool external = false;
bool isXML = false;
if ( filename.right(4) == ".xml") {
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
isXML = true;
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice );
} else {
- Addressee lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
- if ( ! lse.isEmpty() ) {
- if ( lse.familyName().left(4) == "!E: " )
- external = true;
- } else {
- bool found = false;
- AddressBook::Iterator it;
- for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
- if ( (*it).revision().date().year() > 2003 ) {
- found = true;
- break;
- }
- }
- external = ! found;
- }
-
+ external = !manager->mIsKapiFile;
if ( external ) {
qDebug("Setting vcf mode to external ");
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
AddressBook::Iterator it;
for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
(*it).setID( mCurrentSyncDevice, (*it).uid() );
(*it).computeCsum( mCurrentSyncDevice );
}
}
}
//AddressBook::Iterator it;
//QStringList vcards;
//for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
// qDebug("Name %s ", (*it).familyName().latin1());
//}
syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
if ( syncOK ) {
if ( syncManager->mWriteBackFile )
{
if ( external )
abLocal.removeSyncAddressees( !isXML);
qDebug("Saving remote AB ");
if ( ! abLocal.saveAB())
qDebug("Error writing back AB to file ");
if ( isXML ) {
// afterwrite processing
abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
}
}
}
setModified();
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 6baa2ee..5175f94 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -151,64 +151,65 @@ void KSyncManager::slotSyncMenu( int action )
if ( action == 1 ) {
multiSync( true );
return;
}
if ( action == 2 ) {
enableQuick();
QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
return;
}
if ( action == 3 ) {
delete mServerSocket;
mServerSocket = 0;
QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
return;
}
if (blockSave())
return;
setBlockSave(true);
mCurrentSyncProfile = action - 1000 ;
mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ;
mCurrentSyncName = mLocalMachineName ;
KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
KSyncProfile* temp = new KSyncProfile ();
temp->setName(mSyncProfileNames[mCurrentSyncProfile]);
temp->readConfig(&config);
mAskForPreferences = temp->getAskForPreferences();
mSyncAlgoPrefs = temp->getSyncPrefs();
mWriteBackFile = temp->getWriteBackFile();
mWriteBackExistingOnly = temp->getWriteBackExisting();
+ mIsKapiFile = temp->getIsKapiFile();
mWriteBackInFuture = 0;
if ( temp->getWriteBackFuture() )
mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
mShowSyncSummary = temp->getShowSummaryAfterSync();
if ( action == 1000 ) {
syncSharp();
} else if ( action == 1001 ) {
syncLocalFile();
} else if ( action == 1002 ) {
mWriteBackFile = false;
mAskForPreferences = false;
mShowSyncSummary = false;
mSyncAlgoPrefs = 3;
quickSyncLocalFile();
} else if ( action >= 1003 ) {
if ( temp->getIsLocalFileSync() ) {
switch(mTargetApp)
{
case (KAPI):
if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) )
mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB();
break;
case (KOPI):
if ( syncWithFile( temp->getRemoteFileName( ), false ) )
mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName();
break;
case (PWMPI):
if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) )
mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM();
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 5b05383..9094aac 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -105,64 +105,65 @@ class KSyncManager : public QObject
{
Q_OBJECT
public:
enum TargetApp {
KOPI = 0,
KAPI = 1,
PWMPI = 2 };
KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
~KSyncManager() ;
void multiSync( bool askforPrefs );
bool blockSave() { return mBlockSaveFlag; }
void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
void setDefaultFileName( QString s) { mDefFileName = s ;}
QString defaultFileName() { return mDefFileName ;}
QString syncFileName();
QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
QString getCurrentSyncName() { return mCurrentSyncName; }
void showProgressBar(int percentage, QString caption = QString::null, int total=100);
void hideProgressBar();
bool isProgressBarCanceled();
// sync stuff
QString mLocalMachineName;
QStringList mExternSyncProfiles;
QStringList mSyncProfileNames;
bool mAskForPreferences;
bool mShowSyncSummary;
+ bool mIsKapiFile;
bool mWriteBackExistingOnly;
int mSyncAlgoPrefs;
bool mWriteBackFile;
int mWriteBackInFuture;
QString mPhoneDevice;
QString mPhoneConnection;
QString mPhoneModel;
QString mPassWordPiSync;
QString mActiveSyncPort;
QString mActiveSyncIP ;
signals:
void save();
void request_file();
void getFile( bool );
public slots:
void slotSyncMenu( int );
void deleteCommandSocket(KCommandSocket*s, int state);
void readFileFromSocket();
void fillSyncMenu();
private:
void syncPi();
KServerSocket * mServerSocket;
void enableQuick();
KPimPrefs* mPrefs;
QString mDefFileName;
QString mCurrentSyncDevice;
QString mCurrentSyncName;
void quickSyncLocalFile();
bool syncWithFile( QString fn , bool quick );
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index cf8f996..03265d2 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -213,92 +213,94 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mPhoneConnection = new QLineEdit( temphb);
button = new QPushButton( i18n("Help..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
temphb = new QHBox( phoneWidget );
new QLabel( i18n("Model(opt.): "), temphb );
mPhoneModel = new QLineEdit( temphb);
button = new QPushButton( i18n("Help..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
// *** local
localFileWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
++iii;
temphb = new QHBox( localFileWidget );
lab = new QLabel( i18n("Local file Cal:"), temphb );
lab = new QLabel( i18n("Local file ABook:"), temphb );
lab = new QLabel( i18n("Local file PWMgr:"), temphb );
temphb = new QHBox( localFileWidget );
button = new QPushButton( i18n("Choose..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
button = new QPushButton( i18n("Choose..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
button = new QPushButton( i18n("Choose..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
temphb = new QHBox( localFileWidget );
mRemoteFile = new QLineEdit( temphb);
mRemoteFileAB = new QLineEdit( temphb);
mRemoteFilePWM = new QLineEdit( temphb);
+ mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
+
// *** remote
remoteFileWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
++iii;
temphb = new QHBox( remoteFileWidget );
new QLabel( i18n("Calendar:"), temphb);
new QLabel( i18n("AddressBook:"), temphb);
new QLabel( i18n("PWManager:"), temphb);
lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
temphb = new QHBox( remoteFileWidget );
mRemotePrecommand = new QLineEdit(temphb);
mRemotePrecommandAB = new QLineEdit(temphb);
mRemotePrecommandPWM = new QLineEdit(temphb);
lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
temphb = new QHBox( remoteFileWidget );
mLocalTempFile = new QLineEdit(temphb);
mLocalTempFileAB = new QLineEdit(temphb);
mLocalTempFilePWM = new QLineEdit(temphb);
lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
temphb = new QHBox( remoteFileWidget );
mRemotePostcommand = new QLineEdit(temphb );
mRemotePostcommandAB = new QLineEdit(temphb );
mRemotePostcommandPWM = new QLineEdit(temphb );
-
+ mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
temphb = new QHBox( remoteFileWidget );
button = new QPushButton( i18n("ssh/scp"), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
button = new QPushButton( i18n("ftp"), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
// *** pi-sync
piWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
++iii;
temphb = new QHBox( piWidget );
new QLabel( i18n("Calendar:"), temphb);
new QLabel( i18n("AddressBook:"), temphb);
new QLabel( i18n("PWManager:"), temphb);
lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget);
temphb = new QHBox( piWidget );
mRemotePw = new QLineEdit(temphb);
mRemotePwAB = new QLineEdit(temphb);
mRemotePwPWM = new QLineEdit(temphb);
lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
temphb = new QHBox( piWidget );
mRemoteIP = new QLineEdit(temphb);
mRemoteIPAB = new QLineEdit(temphb);
mRemoteIPPWM = new QLineEdit(temphb);
lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
temphb = new QHBox( piWidget );
mRemotePort = new QLineEdit(temphb);
@@ -428,105 +430,114 @@ void KSyncPrefsDialog::profileChanged( int item )
mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
mWriteBackFuture->setChecked( prof->getWriteBackFuture());
mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
switch ( prof->getSyncPrefs() ) {
case 0:
loc->setChecked( true);
break;
case 1:
rem->setChecked( true );
break;
case 2:
newest->setChecked( true);
break;
case 3:
ask->setChecked( true);
break;
case 4:
f_loc->setChecked( true);
break;
case 5:
f_rem->setChecked( true);
break;
case 6:
//both->setChecked( true);
break;
default:
break;
}
mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
mIsPhone->setChecked(prof->getIsPhoneSync()) ;
mIsPi->setChecked(prof->getIsPiSync()) ;
+ mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
+ mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
+
mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() );
proGr->setEnabled( item > 2 );
if ( item < 3 ) {
localFileWidget->hide();
remoteFileWidget->hide();
phoneWidget->hide();
piWidget->hide();
} else
kindChanged( prof->getIsLocalFileSync() );
}
void KSyncPrefsDialog::fillSSH()
{
mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
mLocalTempFile->setText("/tmp/mycalendar.ics" );
mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
mLocalTempFileAB->setText("/tmp/std.vcf" );
mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
}
void KSyncPrefsDialog::fillFTP()
{
mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
mLocalTempFile->setText("/tmp/mycalendar.ics" );
mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
mLocalTempFileAB->setText("/tmp/std.vcf" );
mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
}
void KSyncPrefsDialog::kindChanged( bool b )
{
+ if ( mIsLocal->isChecked () ) {
+ mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() );
+ } else {
+ mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() );
+ }
+
if ( mIsLocal->isChecked () )
localFileWidget->show();
else
localFileWidget->hide();
if ( mIsNotLocal->isChecked () )
remoteFileWidget->show();
else
remoteFileWidget->hide();
if ( mIsPhone->isChecked () ) {
phoneWidget->show();
}
else {
phoneWidget->hide();
}
if ( mIsPi->isChecked () ) {
piWidget->show();
}
else {
piWidget->hide();
}
}
void KSyncPrefsDialog::deleteProfile()
{
//qDebug("KSyncPrefsDialog::deleteProfile() ");
if ( currentSelection >= 0 ) {
if ( currentSelection < 3 ) {
KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
return;
}
@@ -550,64 +561,65 @@ void KSyncPrefsDialog::saveProfile()
prof->setRemotePwAB( mRemotePwAB->text());
prof->setRemoteIPAB( mRemoteIPAB->text());
prof->setRemotePortAB( mRemotePortAB->text());
prof->setRemotePwPWM( mRemotePwPWM->text());
prof->setRemoteIPPWM( mRemoteIPPWM->text());
prof->setRemotePortPWM( mRemotePortPWM->text());
prof->setPreSyncCommand( mRemotePrecommand->text());
prof->setPostSyncCommand( mRemotePostcommand->text() );
prof->setLocalTempFile( mLocalTempFile->text());
prof->setRemoteFileName( mRemoteFile->text() );
prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
prof->setLocalTempFileAB( mLocalTempFileAB->text());
prof->setRemoteFileNameAB( mRemoteFileAB->text() );
prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text());
prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() );
prof->setLocalTempFilePWM( mLocalTempFilePWM->text());
prof->setRemoteFileNamePWM( mRemoteFilePWM->text() );
prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
prof->setAskForPreferences( mAskForPreferences->isChecked());
prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
prof->setWriteBackFile( mWriteBackFile->isChecked());
prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
prof->setSyncPrefs( syncprefs);
prof->setIsLocalFileSync( mIsLocal->isChecked() );
prof->setIsPhoneSync( mIsPhone->isChecked() );
prof->setIsPiSync( mIsPi->isChecked() );
+ prof->setIsKapiFile( mIsKapiFileL->isChecked() );
prof->setWriteBackFuture(mWriteBackFuture->isChecked());
prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
if ( mWriteContactToSIM )
prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
prof->setPhoneDevice( mPhoneDevice->text() );
prof->setPhoneConnection( mPhoneConnection->text() );
prof->setPhoneModel( mPhoneModel->text() );
}
}
void KSyncPrefsDialog::insertProfiles()
{
int curItem = mProfileBox->currentItem();
mProfileBox->blockSignals( true );
mProfileBox->clear();
mProfileBox->insertStringList (mSyncProfileNames );
int item = mSyncProfileNames.count() -1;
if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
mProfileBox->setCurrentItem( curItem );
else if ( item >= 0 ) {
mProfileBox->setCurrentItem( item );
}
currentSelection = -1;
if ( mSyncProfileNames.count() > 0 ) {
//qDebug(" profileChanged( mProfileBox->currentItem() ");
profileChanged( mProfileBox->currentItem() );
currentSelection = mProfileBox->currentItem();
}
mProfileBox->blockSignals( false );
}
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index d3f8f4c..c601a58 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -117,35 +117,37 @@ class KSyncPrefsDialog : public KDialog
QLineEdit * mRemoteFilePWM;
QLineEdit * mLocalTempFilePWM;
QLineEdit * mRemotePw;
QLineEdit * mRemoteIP;
QLineEdit * mRemotePort;
QLineEdit * mRemotePwAB;
QLineEdit * mRemoteIPAB;
QLineEdit * mRemotePortAB;
QLineEdit * mRemotePwPWM;
QLineEdit * mRemoteIPPWM;
QLineEdit * mRemotePortPWM;
QLineEdit * mPhoneDevice;
QLineEdit * mPhoneConnection;
QLineEdit * mPhoneModel;
QWidget* mSetupSyncAlgTab;
QVBox* localFileWidget;
QVBox* remoteFileWidget;
QVBox* phoneWidget;
QVBox* piWidget;
QCheckBox* mWriteBackFile;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
QCheckBox* mWriteBackExisting;
QCheckBox* mAskForPreferences;
QCheckBox* mShowSummaryAfterSync;
QCheckBox* mWriteContactToSIM;
+ QCheckBox* mIsKapiFileL;
+ QCheckBox* mIsKapiFileR;
};
#endif
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 76dfe00..029b70b 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -47,202 +47,206 @@ KSyncProfile* KSyncProfile::clone()
myClone->setRemoteIP(mRemoteIP);
myClone->setRemotePort(mRemotePort);
myClone->setRemotePwAB(mRemotePwAB);
myClone->setRemoteIPAB(mRemoteIPAB);
myClone->setRemotePortAB(mRemotePortAB);
myClone->setRemotePwPWM(mRemotePwPWM);
myClone->setRemoteIPPWM(mRemoteIPPWM);
myClone->setRemotePortPWM (mRemotePortPWM);
myClone->setPreSyncCommand( mPreSyncCommand );
myClone->setPostSyncCommand( mPostSyncCommand );
myClone->setLocalTempFile( mLocalTempFile);
myClone->setRemoteFileName( mRemoteFileName );
myClone->setPreSyncCommandAB( mPreSyncCommandAB );
myClone->setPostSyncCommandAB( mPostSyncCommandAB );
myClone->setLocalTempFileAB( mLocalTempFileAB);
myClone->setRemoteFileNameAB( mRemoteFileNameAB );
myClone->setPreSyncCommandPWM( mPreSyncCommandPWM );
myClone->setPostSyncCommandPWM( mPostSyncCommandPWM );
myClone->setLocalTempFilePWM( mLocalTempFilePWM);
myClone->setRemoteFileNamePWM( mRemoteFileNamePWM );
myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
myClone->setAskForPreferences( mAskForPreferences);
myClone->setWriteBackExisting(mWriteBackExisting );
myClone->setWriteBackFile( mWriteBackFile);
myClone->setWriteBackFuture( mWriteBackFuture );
myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
myClone->setIncludeInRingSync( mIncludeInRingSync );
myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
myClone->setSyncPrefs( mSyncPrefs);
myClone->setIsLocalFileSync( mIsLocalFileSync );
myClone->setIsPhoneSync( mIsPhoneSync );
+ myClone->setIsKapiFile( mIsKapiFile );
myClone->setIsPiSync( mIsPiSync );
myClone->setWriteContactToSIM( mWriteContactToSIM );
myClone->setName( "noName" );
//myClone->setIdentifier( "noID" );
return myClone;
}
void KSyncProfile::setDefault()
{
mPreSyncCommand = i18n("command for downloading remote file to local device");
mPostSyncCommand = i18n("command for uploading local temp file to remote device");
mLocalTempFile = "/tmp/mycalendar.ics";
mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
mPreSyncCommandAB = i18n("command for downloading remote file to local device");
mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
mLocalTempFileAB = "/tmp/std.vcf";
mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
mPreSyncCommandPWM = i18n("command for downloading remote file to local device");
mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
mLocalTempFilePWM = "/tmp/passwords.pwm";
mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
mRemotePw = "abc";
mRemoteIP = "192.168.0.99";
mRemotePort = "9197";
mRemotePwAB = "abc";
mRemoteIPAB = "192.168.0.99";
mRemotePortAB = "9198";
mRemotePwPWM = "abc";
mRemoteIPPWM = "192.168.0.99";
mRemotePortPWM = "9199";
mShowSummaryAfterSync = true;
mAskForPreferences = true;
mWriteBackExisting = false;
mWriteBackFuture = false;
mWriteBackFutureWeeks = 12;
mWriteBackFile = true;
mIncludeInRingSync = false;
mIncludeInRingSyncAB = false;
mIncludeInRingSyncPWM = false;
mSyncPrefs = SYNC_PREF_ASK;
mIsLocalFileSync = true;
mName = "noName";
mIsPhoneSync = false;
mIsPiSync = false;
+ mIsKapiFile = false;
mWriteContactToSIM = false;
mPhoneDevice = "/dev/ircomm";
mPhoneConnection = "irda";
mPhoneModel = "6310i";
}
void KSyncProfile::readConfig(KConfig *config )
{
if (config)
{
config->setGroup( mName );
mName = config->readEntry( "Name", mName );
mRemotePw = config->readEntry( "RemotePw",mRemotePw );
mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP );
mRemotePort = config->readEntry( "RemotePort", mRemotePort );
mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB );
mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB );
mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB );
mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM );
mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM );
mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM );
mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB );
mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB );
mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB );
mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM );
mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice );
mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection );
mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel );
mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync );
mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
+ mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile );
}
else
{
setDefault();
}
}
void KSyncProfile::deleteConfig(KConfig *config )
{
config->deleteGroup( mName );
}
void KSyncProfile::writeConfig( KConfig * config )
{
config->setGroup(mName);
config->writeEntry( "RemotePw", mRemotePw);
config->writeEntry( "RemoteIP", mRemoteIP);
config->writeEntry( "RemotePort", mRemotePort);
config->writeEntry( "RemotePwAB", mRemotePwAB);
config->writeEntry( "RemoteIPAB", mRemoteIPAB);
config->writeEntry( "RemotePortAB", mRemotePortAB);
config->writeEntry( "RemotePwPWM", mRemotePwPWM);
config->writeEntry( "RemoteIPPWM", mRemoteIPPWM);
config->writeEntry( "RemotePortPWM", mRemotePortPWM);
config->writeEntry( "Name", mName );
config->writeEntry( "PreSyncCommand",mPreSyncCommand );
config->writeEntry( "PostSyncCommand", mPostSyncCommand );
config->writeEntry( "LocalTempFile", mLocalTempFile );
config->writeEntry( "RemoteFileName", mRemoteFileName );
config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB );
config->writeEntry( "LocalTempFileAB", mLocalTempFileAB );
config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB );
config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM );
config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
config->writeEntry( "PhoneDevice", mPhoneDevice );
config->writeEntry( "PhoneConnection", mPhoneConnection );
config->writeEntry( "PhoneModel", mPhoneModel );
config->writeEntry( "IncludeInRingSync",mIncludeInRingSync );
config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
config->writeEntry( "AskForPreferences",mAskForPreferences );
config->writeEntry( "WriteBackExisting",mWriteBackExisting );
config->writeEntry( "WriteBackFuture",mWriteBackFuture );
config->writeEntry( "WriteBackFile",mWriteBackFile );
config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
config->writeEntry( "SyncPrefs", mSyncPrefs );
config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
config->writeEntry( "IsPhoneSync", mIsPhoneSync );
config->writeEntry( "IsPiSync", mIsPiSync );
+ config->writeEntry( "IsKapiFile", mIsKapiFile );
}
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index 6a68bd7..0a59111 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -105,81 +105,84 @@ class KSyncProfile : public QObject {
*/
void setName( const QString& n ) {mName = n;}
QString getName( ) { return mName;}
void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;}
bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;}
void setAskForPreferences( bool b ) { mAskForPreferences= b;}
bool getAskForPreferences( ) { return mAskForPreferences;}
void setWriteBackExisting( bool b ) { mWriteBackExisting = b;}
bool getWriteBackExisting( ) { return mWriteBackExisting;}
void setWriteBackFuture( bool b ) { mWriteBackFuture = b;}
bool getWriteBackFuture( ) { return mWriteBackFuture;}
void setWriteBackFile( bool b ) { mWriteBackFile= b;}
bool getWriteBackFile( ) { return mWriteBackFile;}
void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;}
bool getWriteContactToSIM( ) { return mWriteContactToSIM;}
void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;}
bool getIncludeInRingSync( ) { return mIncludeInRingSync;}
void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;}
bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;}
void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;}
bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;}
void setSyncPrefs( int n ) { mSyncPrefs= n;}
int getSyncPrefs( ) { return mSyncPrefs;}
void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
bool getIsPhoneSync( ) { return mIsPhoneSync;}
void setIsPiSync( bool b ) { mIsPiSync= b;}
bool getIsPiSync( ) { return mIsPiSync;}
+ void setIsKapiFile( bool b ) { mIsKapiFile= b;}
+ bool getIsKapiFile( ) { return mIsKapiFile;}
private:
QString mName;
QString mPreSyncCommand;
QString mPostSyncCommand;
QString mLocalTempFile;
QString mRemoteFileName;
QString mPreSyncCommandAB;
QString mPostSyncCommandAB;
QString mLocalTempFileAB;
QString mRemoteFileNameAB;
QString mPreSyncCommandPWM;
QString mPostSyncCommandPWM;
QString mLocalTempFilePWM;
QString mRemoteFileNamePWM;
QString mRemotePw;
QString mRemoteIP;
QString mRemotePort;
QString mRemotePwAB;
QString mRemoteIPAB;
QString mRemotePortAB;
QString mRemotePwPWM;
QString mRemoteIPPWM;
QString mRemotePortPWM;
QString mPhoneDevice;
QString mPhoneConnection;
QString mPhoneModel;
bool mIncludeInRingSync;
bool mIncludeInRingSyncAB;
bool mIncludeInRingSyncPWM;
int mSyncPrefs;
bool mWriteBackFile;
bool mWriteBackExisting;
bool mWriteBackFuture;
int mWriteBackFutureWeeks;
bool mAskForPreferences;
bool mShowSummaryAfterSync;
bool mIsLocalFileSync;
bool mIsPhoneSync;
bool mWriteContactToSIM;
bool mIsPiSync;
+ bool mIsKapiFile;
};
#endif