Diffstat (limited to 'kmicromail/libmailwrapper/settings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 90e32fa..f996d9c 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -168,43 +168,55 @@ void IMAPaccount::read() | |||
168 | if (server.isNull()) server=""; | 168 | if (server.isNull()) server=""; |
169 | port = conf->readEntry( "Port","" ); | 169 | port = conf->readEntry( "Port","" ); |
170 | if (port.isNull()) port="143"; | 170 | if (port.isNull()) port="143"; |
171 | connectionType = conf->readNumEntry( "ConnectionType" ); | 171 | connectionType = conf->readNumEntry( "ConnectionType" ); |
172 | ssl = conf->readBoolEntry( "SSL",false ); | 172 | ssl = conf->readBoolEntry( "SSL",false ); |
173 | user = conf->readEntry( "User","" ); | 173 | user = conf->readEntry( "User","" ); |
174 | if (user.isNull()) user = ""; | 174 | if (user.isNull()) user = ""; |
175 | password = conf->readEntryCrypt( "Password","" ); | 175 | password = conf->readEntryCrypt( "Password","" ); |
176 | if (password.isNull()) password = ""; | 176 | if (password.isNull()) password = ""; |
177 | prefix = conf->readEntry("MailPrefix",""); | 177 | prefix = conf->readEntry("MailPrefix",""); |
178 | if (prefix.isNull()) prefix = ""; | 178 | if (prefix.isNull()) prefix = ""; |
179 | offline = conf->readBoolEntry("Offline",false); | 179 | offline = conf->readBoolEntry("Offline",false); |
180 | localFolder = conf->readEntry( "LocalFolder" ); | ||
181 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); | ||
182 | int lf = conf->readNumEntry( "LastFetch",0 ); | ||
183 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | ||
184 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); | ||
185 | lastFetch = dt.addSecs( lf ); | ||
180 | delete conf; | 186 | delete conf; |
181 | } | 187 | } |
182 | 188 | ||
183 | void IMAPaccount::save() | 189 | void IMAPaccount::save() |
184 | { | 190 | { |
185 | qDebug("saving %s ",getFileName().latin1() ); | 191 | qDebug("saving %s ",getFileName().latin1() ); |
186 | Settings::checkDirectory(); | 192 | Settings::checkDirectory(); |
187 | 193 | ||
188 | Config *conf = new Config( getFileName(), Config::File ); | 194 | Config *conf = new Config( getFileName(), Config::File ); |
189 | conf->setGroup( "IMAP Account" ); | 195 | conf->setGroup( "IMAP Account" ); |
190 | conf->writeEntry( "Account", accountName ); | 196 | conf->writeEntry( "Account", accountName ); |
191 | conf->writeEntry( "Server", server ); | 197 | conf->writeEntry( "Server", server ); |
192 | conf->writeEntry( "Port", port ); | 198 | conf->writeEntry( "Port", port ); |
193 | conf->writeEntry( "SSL", ssl ); | 199 | conf->writeEntry( "SSL", ssl ); |
194 | conf->writeEntry( "ConnectionType", connectionType ); | 200 | conf->writeEntry( "ConnectionType", connectionType ); |
195 | conf->writeEntry( "User", user ); | 201 | conf->writeEntry( "User", user ); |
196 | conf->writeEntryCrypt( "Password", password ); | 202 | conf->writeEntryCrypt( "Password", password ); |
197 | conf->writeEntry( "MailPrefix",prefix); | 203 | conf->writeEntry( "MailPrefix",prefix); |
198 | conf->writeEntry( "Offline",offline); | 204 | conf->writeEntry( "Offline",offline); |
205 | conf->writeEntry( "LocalFolder", localFolder ); | ||
206 | conf->writeEntry( "MaxSize", maxMailSize ); | ||
207 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | ||
208 | int lf = dt.secsTo ( lastFetch ); | ||
209 | conf->writeEntry( "LastFetch", lf ); | ||
210 | conf->writeEntry( "LeaveOnServer", leaveOnServer); | ||
199 | conf->write(); | 211 | conf->write(); |
200 | delete conf; | 212 | delete conf; |
201 | } | 213 | } |
202 | 214 | ||
203 | 215 | ||
204 | QString IMAPaccount::getFileName() | 216 | QString IMAPaccount::getFileName() |
205 | { | 217 | { |
206 | return locateLocal("data", "kopiemail" ) +"/imap-" + file; | 218 | return locateLocal("data", "kopiemail" ) +"/imap-" + file; |
207 | } | 219 | } |
208 | 220 | ||
209 | POP3account::POP3account() | 221 | POP3account::POP3account() |
210 | : Account() | 222 | : Account() |
@@ -250,47 +262,49 @@ void POP3account::read() | |||
250 | accountName = conf->readEntry( "Account" ); | 262 | accountName = conf->readEntry( "Account" ); |
251 | server = conf->readEntry( "Server" ); | 263 | server = conf->readEntry( "Server" ); |
252 | port = conf->readEntry( "Port" ); | 264 | port = conf->readEntry( "Port" ); |
253 | ssl = conf->readBoolEntry( "SSL" ); | 265 | ssl = conf->readBoolEntry( "SSL" ); |
254 | connectionType = conf->readNumEntry( "ConnectionType" ); | 266 | connectionType = conf->readNumEntry( "ConnectionType" ); |
255 | user = conf->readEntry( "User" ); | 267 | user = conf->readEntry( "User" ); |
256 | password = conf->readEntryCrypt( "Password" ); | 268 | password = conf->readEntryCrypt( "Password" ); |
257 | offline = conf->readBoolEntry("Offline",false); | 269 | offline = conf->readBoolEntry("Offline",false); |
258 | localFolder = conf->readEntry( "LocalFolder" ); | 270 | localFolder = conf->readEntry( "LocalFolder" ); |
259 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); | 271 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); |
260 | int lf = conf->readNumEntry( "LastFetch",0 ); | 272 | int lf = conf->readNumEntry( "LastFetch",0 ); |
261 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | 273 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); |
274 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); | ||
262 | lastFetch = dt.addSecs( lf ); | 275 | lastFetch = dt.addSecs( lf ); |
263 | delete conf; | 276 | delete conf; |
264 | } | 277 | } |
265 | 278 | ||
266 | void POP3account::save() | 279 | void POP3account::save() |
267 | { | 280 | { |
268 | Settings::checkDirectory(); | 281 | Settings::checkDirectory(); |
269 | 282 | ||
270 | Config *conf = new Config( getFileName(), Config::File ); | 283 | Config *conf = new Config( getFileName(), Config::File ); |
271 | conf->setGroup( "POP3 Account" ); | 284 | conf->setGroup( "POP3 Account" ); |
272 | conf->writeEntry( "Account", accountName ); | 285 | conf->writeEntry( "Account", accountName ); |
273 | conf->writeEntry( "Server", server ); | 286 | conf->writeEntry( "Server", server ); |
274 | conf->writeEntry( "Port", port ); | 287 | conf->writeEntry( "Port", port ); |
275 | conf->writeEntry( "SSL", ssl ); | 288 | conf->writeEntry( "SSL", ssl ); |
276 | conf->writeEntry( "ConnectionType", connectionType ); | 289 | conf->writeEntry( "ConnectionType", connectionType ); |
277 | conf->writeEntry( "User", user ); | 290 | conf->writeEntry( "User", user ); |
278 | conf->writeEntryCrypt( "Password", password ); | 291 | conf->writeEntryCrypt( "Password", password ); |
279 | conf->writeEntry( "Offline",offline); | 292 | conf->writeEntry( "Offline",offline); |
280 | conf->writeEntry( "LocalFolder", localFolder ); | 293 | conf->writeEntry( "LocalFolder", localFolder ); |
281 | conf->writeEntry( "MaxSize", maxMailSize ); | 294 | conf->writeEntry( "MaxSize", maxMailSize ); |
282 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | 295 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); |
283 | int lf = dt.secsTo ( lastFetch ); | 296 | int lf = dt.secsTo ( lastFetch ); |
284 | conf->writeEntry( "LastFetch", lf ); | 297 | conf->writeEntry( "LastFetch", lf ); |
298 | conf->writeEntry( "LeaveOnServer", leaveOnServer); | ||
285 | conf->write(); | 299 | conf->write(); |
286 | delete conf; | 300 | delete conf; |
287 | } | 301 | } |
288 | 302 | ||
289 | 303 | ||
290 | QString POP3account::getFileName() | 304 | QString POP3account::getFileName() |
291 | { | 305 | { |
292 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; | 306 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; |
293 | } | 307 | } |
294 | 308 | ||
295 | SMTPaccount::SMTPaccount() | 309 | SMTPaccount::SMTPaccount() |
296 | : Account() | 310 | : Account() |