-rw-r--r-- | libkdepim/ksyncprofile.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 15dc152..e7c35fb 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp @@ -17,71 +17,66 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // $Id$ #include <qcolor.h> #include <kconfig.h> #include <kstandarddirs.h> #include <kglobal.h> #include <kdebug.h> #include "ksyncprofile.h" -KSyncProfile::KSyncProfile( const char * identifier): QObject (0, identifier ) +KSyncProfile::KSyncProfile(): QObject () { - setIdentifier( identifier ); - - if (getIdentifier().isEmpty()) - setIdentifier( "noID" ); - setDefault(); } KSyncProfile::~KSyncProfile() { } KSyncProfile* KSyncProfile::clone() { KSyncProfile* myClone = new KSyncProfile(); 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->setShowSummaryAfterSync( mShowSummaryAfterSync ); myClone->setAskForPreferences( mAskForPreferences); myClone->setWriteBackExisting(mWriteBackExisting ); myClone->setWriteBackFile( mWriteBackFile); myClone->setWriteBackFuture( mWriteBackFuture ); myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); myClone->setIncludeInRingSync( mIncludeInRingSync ); myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); myClone->setSyncPrefs( mSyncPrefs); myClone->setIsLocalFileSync( mIsLocalFileSync ); myClone->setIsPhoneSync( mIsPhoneSync ); myClone->setName( "noName" ); - myClone->setIdentifier( "noID" ); + //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"; mShowSummaryAfterSync = true; mAskForPreferences = true; @@ -91,33 +86,33 @@ void KSyncProfile::setDefault() mWriteBackFile = true; mIncludeInRingSync = false; mIncludeInRingSyncAB = false; mSyncPrefs = SYNC_PREF_ASK; mIsLocalFileSync = true; mName = "noName"; mIsPhoneSync = false; mPhoneDevice = "/dev/ircomm"; mPhoneConnection = "irda"; mPhoneModel = "6310i"; } void KSyncProfile::readConfig(KConfig *config ) { if (config) { - config->setGroup("SyncProfile_" + mIdentifier); + config->setGroup( mName ); mName = config->readEntry( "Name", mName ); 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 ); mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); @@ -127,38 +122,38 @@ void KSyncProfile::readConfig(KConfig *config ) mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); } else { setDefault(); } } void KSyncProfile::deleteConfig(KConfig *config ) { - config->deleteGroup( "SyncProfile_" + mIdentifier ); + config->deleteGroup( mName ); } void KSyncProfile::writeConfig( KConfig * config ) { - config->setGroup("SyncProfile_" + mIdentifier); + config->setGroup(mName); 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( "PhoneDevice", mPhoneDevice ); config->writeEntry( "PhoneConnection", mPhoneConnection ); config->writeEntry( "PhoneModel", mPhoneModel ); |