summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprofile.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprofile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprofile.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index c599208..a43ebe2 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -38,101 +38,117 @@ KSyncProfile::~KSyncProfile()
38{ 38{
39 39
40} 40}
41 41
42 42
43KSyncProfile* KSyncProfile::clone() 43KSyncProfile* 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->setPreSyncCommandAB( mPreSyncCommandAB ); 50 myClone->setPreSyncCommandAB( mPreSyncCommandAB );
51 myClone->setPostSyncCommandAB( mPostSyncCommandAB ); 51 myClone->setPostSyncCommandAB( mPostSyncCommandAB );
52 myClone->setLocalTempFileAB( mLocalTempFileAB); 52 myClone->setLocalTempFileAB( mLocalTempFileAB);
53 myClone->setRemoteFileNameAB( mRemoteFileNameAB ); 53 myClone->setRemoteFileNameAB( mRemoteFileNameAB );
54 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM );
55 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM );
56 myClone->setLocalTempFilePWM( mLocalTempFilePWM);
57 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM );
54 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 58 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
55 myClone->setAskForPreferences( mAskForPreferences); 59 myClone->setAskForPreferences( mAskForPreferences);
56 myClone->setWriteBackExisting(mWriteBackExisting ); 60 myClone->setWriteBackExisting(mWriteBackExisting );
57 myClone->setWriteBackFile( mWriteBackFile); 61 myClone->setWriteBackFile( mWriteBackFile);
58 myClone->setWriteBackFuture( mWriteBackFuture ); 62 myClone->setWriteBackFuture( mWriteBackFuture );
59 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 63 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
60 myClone->setIncludeInRingSync( mIncludeInRingSync ); 64 myClone->setIncludeInRingSync( mIncludeInRingSync );
61 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 65 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
66 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
62 myClone->setSyncPrefs( mSyncPrefs); 67 myClone->setSyncPrefs( mSyncPrefs);
63 myClone->setIsLocalFileSync( mIsLocalFileSync ); 68 myClone->setIsLocalFileSync( mIsLocalFileSync );
64 myClone->setIsPhoneSync( mIsPhoneSync ); 69 myClone->setIsPhoneSync( mIsPhoneSync );
65 myClone->setWriteContactToSIM( mWriteContactToSIM ); 70 myClone->setWriteContactToSIM( mWriteContactToSIM );
66 myClone->setName( "noName" ); 71 myClone->setName( "noName" );
67 //myClone->setIdentifier( "noID" ); 72 //myClone->setIdentifier( "noID" );
68 return myClone; 73 return myClone;
69} 74}
70 75
71 76
72void KSyncProfile::setDefault() 77void KSyncProfile::setDefault()
73{ 78{
74 mPreSyncCommand = i18n("command for downloading remote file to local device"); 79 mPreSyncCommand = i18n("command for downloading remote file to local device");
75 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 80 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
76 mLocalTempFile = "/tmp/mycalendar.ics"; 81 mLocalTempFile = "/tmp/mycalendar.ics";
77 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; 82 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
78 mPreSyncCommandAB = i18n("command for downloading remote file to local device"); 83 mPreSyncCommandAB = i18n("command for downloading remote file to local device");
79 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); 84 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
80 mLocalTempFileAB = "/tmp/std.vcf"; 85 mLocalTempFileAB = "/tmp/std.vcf";
81 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; 86 mRemoteFileNamePWM = "/home/polo/kdepim/apps/kabc/localfile.vcf";
87 mPreSyncCommandPWM = i18n("command for downloading remote file to local device");
88 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
89 mLocalTempFilePWM = "/tmp/passwords.pwm";
90 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
82 mShowSummaryAfterSync = true; 91 mShowSummaryAfterSync = true;
83 mAskForPreferences = true; 92 mAskForPreferences = true;
84 mWriteBackExisting = false; 93 mWriteBackExisting = false;
85 mWriteBackFuture = false; 94 mWriteBackFuture = false;
86 mWriteBackFutureWeeks = 12; 95 mWriteBackFutureWeeks = 12;
87 mWriteBackFile = true; 96 mWriteBackFile = true;
88 mIncludeInRingSync = false; 97 mIncludeInRingSync = false;
89 mIncludeInRingSyncAB = false; 98 mIncludeInRingSyncAB = false;
99 mIncludeInRingSyncPWM = false;
90 mSyncPrefs = SYNC_PREF_ASK; 100 mSyncPrefs = SYNC_PREF_ASK;
91 mIsLocalFileSync = true; 101 mIsLocalFileSync = true;
92 mName = "noName"; 102 mName = "noName";
93 mIsPhoneSync = false; 103 mIsPhoneSync = false;
94 mWriteContactToSIM = false; 104 mWriteContactToSIM = false;
95 mPhoneDevice = "/dev/ircomm"; 105 mPhoneDevice = "/dev/ircomm";
96 mPhoneConnection = "irda"; 106 mPhoneConnection = "irda";
97 mPhoneModel = "6310i"; 107 mPhoneModel = "6310i";
98} 108}
99void KSyncProfile::readConfig(KConfig *config ) 109void KSyncProfile::readConfig(KConfig *config )
100{ 110{
101 if (config) 111 if (config)
102 { 112 {
103 113
104 config->setGroup( mName ); 114 config->setGroup( mName );
105 115
106 mName = config->readEntry( "Name", mName ); 116 mName = config->readEntry( "Name", mName );
107 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); 117 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
108 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); 118 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
109 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); 119 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
110 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); 120 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
111 121
112 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 122 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
113 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 123 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB );
114 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); 124 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB );
115 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 125 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB );
116 126
127 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
128 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
129 mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM );
130 mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
131
117 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); 132 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice );
118 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); 133 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection );
119 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); 134 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel );
120 135
121 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); 136 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync );
122 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 137 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
138 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
123 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 139 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
124 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 140 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
125 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 141 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
126 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 142 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
127 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 143 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
128 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 144 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
129 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 145 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
130 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 146 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
131 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 147 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
132 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); 148 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
133 } 149 }
134 else 150 else
135 { 151 {
136 setDefault(); 152 setDefault();
137 } 153 }
138} 154}
@@ -144,34 +160,40 @@ void KSyncProfile::deleteConfig(KConfig *config )
144 160
145void KSyncProfile::writeConfig( KConfig * config ) 161void KSyncProfile::writeConfig( KConfig * config )
146{ 162{
147 config->setGroup(mName); 163 config->setGroup(mName);
148 164
149 config->writeEntry( "Name", mName ); 165 config->writeEntry( "Name", mName );
150 config->writeEntry( "PreSyncCommand",mPreSyncCommand ); 166 config->writeEntry( "PreSyncCommand",mPreSyncCommand );
151 config->writeEntry( "PostSyncCommand", mPostSyncCommand ); 167 config->writeEntry( "PostSyncCommand", mPostSyncCommand );
152 config->writeEntry( "LocalTempFile", mLocalTempFile ); 168 config->writeEntry( "LocalTempFile", mLocalTempFile );
153 config->writeEntry( "RemoteFileName", mRemoteFileName ); 169 config->writeEntry( "RemoteFileName", mRemoteFileName );
154 170
155 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 171 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
156 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 172 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB );
157 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); 173 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB );
158 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 174 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB );
159 175
176 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
177 config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
178 config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM );
179 config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
180
160 config->writeEntry( "PhoneDevice", mPhoneDevice ); 181 config->writeEntry( "PhoneDevice", mPhoneDevice );
161 config->writeEntry( "PhoneConnection", mPhoneConnection ); 182 config->writeEntry( "PhoneConnection", mPhoneConnection );
162 config->writeEntry( "PhoneModel", mPhoneModel ); 183 config->writeEntry( "PhoneModel", mPhoneModel );
163 184
164 config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); 185 config->writeEntry( "IncludeInRingSync",mIncludeInRingSync );
165 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 186 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
187 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
166 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 188 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
167 config->writeEntry( "AskForPreferences",mAskForPreferences ); 189 config->writeEntry( "AskForPreferences",mAskForPreferences );
168 config->writeEntry( "WriteBackExisting",mWriteBackExisting ); 190 config->writeEntry( "WriteBackExisting",mWriteBackExisting );
169 config->writeEntry( "WriteBackFuture",mWriteBackFuture ); 191 config->writeEntry( "WriteBackFuture",mWriteBackFuture );
170 config->writeEntry( "WriteBackFile",mWriteBackFile ); 192 config->writeEntry( "WriteBackFile",mWriteBackFile );
171 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); 193 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
172 config->writeEntry( "SyncPrefs", mSyncPrefs ); 194 config->writeEntry( "SyncPrefs", mSyncPrefs );
173 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); 195 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
174 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); 196 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
175 config->writeEntry( "IsPhoneSync", mIsPhoneSync ); 197 config->writeEntry( "IsPhoneSync", mIsPhoneSync );
176} 198}
177 199