author | zautrix <zautrix> | 2004-10-13 03:05:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-13 03:05:35 (UTC) |
commit | 8f852fddc2dc5b63511d6ad1c85a1e74141969ff (patch) (side-by-side diff) | |
tree | 123c7e845e1520a4dcd50dd2361252cc6ab7a76a | |
parent | e7833b80c28e38bfe6316ee5fce150635cdebe03 (diff) | |
download | kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.zip kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.gz kdepimpi-8f852fddc2dc5b63511d6ad1c85a1e74141969ff.tar.bz2 |
fixed one syncing problem
-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 @@ -2734,22 +2734,7 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 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; diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 6baa2ee..5175f94 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -180,6 +180,7 @@ void KSyncManager::slotSyncMenu( int action ) mSyncAlgoPrefs = temp->getSyncPrefs(); mWriteBackFile = temp->getWriteBackFile(); mWriteBackExistingOnly = temp->getWriteBackExisting(); + mIsKapiFile = temp->getIsKapiFile(); mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 5b05383..9094aac 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -134,6 +134,7 @@ class KSyncManager : public QObject QStringList mSyncProfileNames; bool mAskForPreferences; bool mShowSyncSummary; + bool mIsKapiFile; bool mWriteBackExistingOnly; int mSyncAlgoPrefs; bool mWriteBackFile; diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index cf8f996..03265d2 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -242,6 +242,8 @@ void KSyncPrefsDialog::setupSyncAlgTab() 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); @@ -269,7 +271,7 @@ void KSyncPrefsDialog::setupSyncAlgTab() 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 ); @@ -457,6 +459,9 @@ void KSyncPrefsDialog::profileChanged( int item ) 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 ) { @@ -497,6 +502,12 @@ void KSyncPrefsDialog::fillFTP() } void KSyncPrefsDialog::kindChanged( bool b ) { + + if ( mIsLocal->isChecked () ) { + mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); + } else { + mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); + } if ( mIsLocal->isChecked () ) localFileWidget->show(); @@ -579,6 +590,7 @@ void KSyncPrefsDialog::saveProfile() 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 ) diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index d3f8f4c..c601a58 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h @@ -146,6 +146,8 @@ class KSyncPrefsDialog : public KDialog 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 @@ -76,6 +76,7 @@ KSyncProfile* KSyncProfile::clone() myClone->setSyncPrefs( mSyncPrefs); myClone->setIsLocalFileSync( mIsLocalFileSync ); myClone->setIsPhoneSync( mIsPhoneSync ); + myClone->setIsKapiFile( mIsKapiFile ); myClone->setIsPiSync( mIsPiSync ); myClone->setWriteContactToSIM( mWriteContactToSIM ); myClone->setName( "noName" ); @@ -125,6 +126,7 @@ void KSyncProfile::setDefault() mName = "noName"; mIsPhoneSync = false; mIsPiSync = false; + mIsKapiFile = false; mWriteContactToSIM = false; mPhoneDevice = "/dev/ircomm"; mPhoneConnection = "irda"; @@ -182,6 +184,7 @@ void KSyncProfile::readConfig(KConfig *config ) mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); + mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); } else { @@ -244,5 +247,6 @@ void KSyncProfile::writeConfig( KConfig * config ) 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 @@ -134,6 +134,8 @@ class KSyncProfile : public QObject { 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; @@ -180,6 +182,7 @@ class KSyncProfile : public QObject { bool mWriteContactToSIM; bool mIsPiSync; + bool mIsKapiFile; }; #endif |