-rw-r--r-- | kaddressbook/kabcore.cpp | 17 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 14 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 2 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 3 |
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 @@ -2735,20 +2735,5 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 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 "); diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 6baa2ee..5175f94 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -181,4 +181,5 @@ void KSyncManager::slotSyncMenu( int action ) mWriteBackFile = temp->getWriteBackFile(); mWriteBackExistingOnly = temp->getWriteBackExisting(); + mIsKapiFile = temp->getIsKapiFile(); mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 5b05383..9094aac 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -135,4 +135,5 @@ class KSyncManager : public QObject bool mAskForPreferences; bool mShowSyncSummary; + bool mIsKapiFile; bool mWriteBackExistingOnly; int mSyncAlgoPrefs; diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index cf8f996..03265d2 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -243,4 +243,6 @@ void KSyncPrefsDialog::setupSyncAlgTab() mRemoteFileAB = new QLineEdit( temphb); mRemoteFilePWM = new QLineEdit( temphb); + mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); + // *** remote @@ -270,5 +272,5 @@ void KSyncPrefsDialog::setupSyncAlgTab() 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 ); @@ -458,4 +460,7 @@ void KSyncPrefsDialog::profileChanged( int item ) 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 ); @@ -499,4 +504,10 @@ void KSyncPrefsDialog::kindChanged( bool b ) { + if ( mIsLocal->isChecked () ) { + mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); + } else { + mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); + } + if ( mIsLocal->isChecked () ) localFileWidget->show(); @@ -580,4 +591,5 @@ void KSyncPrefsDialog::saveProfile() prof->setIsPhoneSync( mIsPhone->isChecked() ); prof->setIsPiSync( mIsPi->isChecked() ); + prof->setIsKapiFile( mIsKapiFileL->isChecked() ); prof->setWriteBackFuture(mWriteBackFuture->isChecked()); prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index d3f8f4c..c601a58 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h @@ -147,4 +147,6 @@ class KSyncPrefsDialog : public KDialog QCheckBox* mShowSummaryAfterSync; QCheckBox* mWriteContactToSIM; + QCheckBox* mIsKapiFileL; + QCheckBox* mIsKapiFileR; }; diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 76dfe00..029b70b 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp @@ -77,4 +77,5 @@ KSyncProfile* KSyncProfile::clone() myClone->setIsLocalFileSync( mIsLocalFileSync ); myClone->setIsPhoneSync( mIsPhoneSync ); + myClone->setIsKapiFile( mIsKapiFile ); myClone->setIsPiSync( mIsPiSync ); myClone->setWriteContactToSIM( mWriteContactToSIM ); @@ -126,4 +127,5 @@ void KSyncProfile::setDefault() mIsPhoneSync = false; mIsPiSync = false; + mIsKapiFile = false; mWriteContactToSIM = false; mPhoneDevice = "/dev/ircomm"; @@ -183,4 +185,5 @@ void KSyncProfile::readConfig(KConfig *config ) mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); + mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); } else @@ -245,4 +248,5 @@ void KSyncProfile::writeConfig( KConfig * config ) 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 @@ -135,4 +135,6 @@ class KSyncProfile : public QObject { void setIsPiSync( bool b ) { mIsPiSync= b;} bool getIsPiSync( ) { return mIsPiSync;} + void setIsKapiFile( bool b ) { mIsKapiFile= b;} + bool getIsKapiFile( ) { return mIsKapiFile;} private: QString mName; @@ -181,4 +183,5 @@ class KSyncProfile : public QObject { bool mIsPiSync; + bool mIsKapiFile; }; |