-rw-r--r-- | libkdepim/ksyncprofile.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index d6d8fa3..ea41a85 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -39,79 +39,83 @@ KSyncProfile::~KSyncProfile() | |||
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
44 | { | 44 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setPreSyncCommand( mPreSyncCommand ); | 46 | myClone->setPreSyncCommand( mPreSyncCommand ); |
47 | myClone->setPostSyncCommand( mPostSyncCommand ); | 47 | myClone->setPostSyncCommand( mPostSyncCommand ); |
48 | myClone->setLocalTempFile( mLocalTempFile); | 48 | myClone->setLocalTempFile( mLocalTempFile); |
49 | myClone->setRemoteFileName( mRemoteFileName ); | 49 | myClone->setRemoteFileName( mRemoteFileName ); |
50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
51 | myClone->setAskForPreferences( mAskForPreferences); | 51 | myClone->setAskForPreferences( mAskForPreferences); |
52 | myClone->setWriteBackExisting(mWriteBackExisting ); | 52 | myClone->setWriteBackExisting(mWriteBackExisting ); |
53 | myClone->setWriteBackFile( mWriteBackFile); | 53 | myClone->setWriteBackFile( mWriteBackFile); |
54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
55 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | ||
55 | myClone->setSyncPrefs( mSyncPrefs); | 56 | myClone->setSyncPrefs( mSyncPrefs); |
56 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 57 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
57 | myClone->setName( "noName" ); | 58 | myClone->setName( "noName" ); |
58 | return myClone; | 59 | return myClone; |
59 | } | 60 | } |
60 | 61 | ||
61 | 62 | ||
62 | void KSyncProfile::setDefault() | 63 | void KSyncProfile::setDefault() |
63 | { | 64 | { |
64 | mName = "noName"; | 65 | mName = "noName"; |
65 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 66 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
66 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 67 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
67 | mLocalTempFile = "/tmp/mycalendar.ics"; | 68 | mLocalTempFile = "/tmp/mycalendar.ics"; |
68 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 69 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
69 | mShowSummaryAfterSync = true; | 70 | mShowSummaryAfterSync = true; |
70 | mAskForPreferences = true; | 71 | mAskForPreferences = true; |
71 | mWriteBackExisting = false; | 72 | mWriteBackExisting = false; |
72 | mWriteBackFile = true; | 73 | mWriteBackFile = true; |
73 | mIncludeInRingSync = false; | 74 | mIncludeInRingSync = false; |
75 | mIncludeInRingSyncAB = false; | ||
74 | mSyncPrefs = SYNC_PREF_ASK; | 76 | mSyncPrefs = SYNC_PREF_ASK; |
75 | mIsLocalFileSync = true; | 77 | mIsLocalFileSync = true; |
76 | 78 | ||
77 | } | 79 | } |
78 | void KSyncProfile::readConfig(KConfig *config ) | 80 | void KSyncProfile::readConfig(KConfig *config ) |
79 | { | 81 | { |
80 | config->setGroup("SyncProfiles"); | 82 | config->setGroup("SyncProfiles"); |
81 | QString prefix = "Profile_"+mName+"_"; | 83 | QString prefix = "Profile_"+mName+"_"; |
82 | //mName = config->readEntry( prefix+ "Name", mName ); | 84 | //mName = config->readEntry( prefix+ "Name", mName ); |
83 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 85 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
84 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 86 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
85 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 87 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
88 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
86 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 89 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
87 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 90 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
88 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 91 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
89 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 92 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
90 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 93 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
91 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 94 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
92 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 95 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
93 | } | 96 | } |
94 | void KSyncProfile::writeConfig( KConfig * config ) | 97 | void KSyncProfile::writeConfig( KConfig * config ) |
95 | { | 98 | { |
96 | config->setGroup("SyncProfiles"); | 99 | config->setGroup("SyncProfiles"); |
97 | QString prefix = "Profile_"+mName+"_"; | 100 | QString prefix = "Profile_"+mName+"_"; |
98 | // config->writeEntry( prefix+ "Name", mName ); | 101 | // config->writeEntry( prefix+ "Name", mName ); |
99 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 102 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
100 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 103 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
101 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 104 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
105 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
102 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 106 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
103 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 107 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
104 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 108 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
105 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 109 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
106 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 110 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
107 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 111 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
108 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 112 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
109 | } | 113 | } |
110 | 114 | ||
111 | /* | 115 | /* |
112 | class KPrefsItemInt : public KPrefsItem { | 116 | class KPrefsItemInt : public KPrefsItem { |
113 | public: | 117 | public: |
114 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); | 118 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); |
115 | virtual ~KPrefsItemInt() {} | 119 | virtual ~KPrefsItemInt() {} |
116 | 120 | ||
117 | void setDefault(); | 121 | void setDefault(); |