Diffstat (limited to 'noncore/net/mail/libmailwrapper/settings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 83e51e3..7b6a58d 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -274,38 +274,40 @@ void POP3account::save() | |||
274 | 274 | ||
275 | QString POP3account::getFileName() | 275 | QString POP3account::getFileName() |
276 | { | 276 | { |
277 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file; | 277 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/pop3-" + file; |
278 | } | 278 | } |
279 | 279 | ||
280 | SMTPaccount::SMTPaccount() | 280 | SMTPaccount::SMTPaccount() |
281 | : Account() | 281 | : Account() |
282 | { | 282 | { |
283 | file = SMTPaccount::getUniqueFileName(); | 283 | file = SMTPaccount::getUniqueFileName(); |
284 | accountName = "New SMTP Account"; | 284 | accountName = "New SMTP Account"; |
285 | ssl = false; | 285 | ssl = false; |
286 | connectionType = 1; | ||
286 | login = false; | 287 | login = false; |
287 | useCC = false; | 288 | useCC = false; |
288 | useBCC = false; | 289 | useBCC = false; |
289 | useReply = false; | 290 | useReply = false; |
290 | type = "SMTP"; | 291 | type = "SMTP"; |
291 | port = SMTP_PORT; | 292 | port = SMTP_PORT; |
292 | } | 293 | } |
293 | 294 | ||
294 | SMTPaccount::SMTPaccount( QString filename ) | 295 | SMTPaccount::SMTPaccount( QString filename ) |
295 | : Account() | 296 | : Account() |
296 | { | 297 | { |
297 | file = filename; | 298 | file = filename; |
298 | accountName = "New SMTP Account"; | 299 | accountName = "New SMTP Account"; |
299 | ssl = false; | 300 | ssl = false; |
301 | connectionType = 1; | ||
300 | login = false; | 302 | login = false; |
301 | type = "SMTP"; | 303 | type = "SMTP"; |
302 | port = SMTP_PORT; | 304 | port = SMTP_PORT; |
303 | } | 305 | } |
304 | 306 | ||
305 | QString SMTPaccount::getUniqueFileName() | 307 | QString SMTPaccount::getUniqueFileName() |
306 | { | 308 | { |
307 | int num = 0; | 309 | int num = 0; |
308 | QString unique; | 310 | QString unique; |
309 | 311 | ||
310 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 312 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
311 | 313 | ||
@@ -316,41 +318,43 @@ QString SMTPaccount::getUniqueFileName() | |||
316 | 318 | ||
317 | return unique; | 319 | return unique; |
318 | } | 320 | } |
319 | 321 | ||
320 | void SMTPaccount::read() | 322 | void SMTPaccount::read() |
321 | { | 323 | { |
322 | Config *conf = new Config( getFileName(), Config::File ); | 324 | Config *conf = new Config( getFileName(), Config::File ); |
323 | conf->setGroup( "SMTP Account" ); | 325 | conf->setGroup( "SMTP Account" ); |
324 | accountName = conf->readEntry( "Account" ); | 326 | accountName = conf->readEntry( "Account" ); |
325 | server = conf->readEntry( "Server" ); | 327 | server = conf->readEntry( "Server" ); |
326 | port = conf->readEntry( "Port" ); | 328 | port = conf->readEntry( "Port" ); |
327 | ssl = conf->readBoolEntry( "SSL" ); | 329 | ssl = conf->readBoolEntry( "SSL" ); |
330 | connectionType = conf->readNumEntry( "ConnectionType" ); | ||
328 | login = conf->readBoolEntry( "Login" ); | 331 | login = conf->readBoolEntry( "Login" ); |
329 | user = conf->readEntry( "User" ); | 332 | user = conf->readEntry( "User" ); |
330 | password = conf->readEntryCrypt( "Password" ); | 333 | password = conf->readEntryCrypt( "Password" ); |
331 | delete conf; | 334 | delete conf; |
332 | } | 335 | } |
333 | 336 | ||
334 | void SMTPaccount::save() | 337 | void SMTPaccount::save() |
335 | { | 338 | { |
336 | qDebug( "saving " + getFileName() ); | 339 | qDebug( "saving " + getFileName() ); |
337 | Settings::checkDirectory(); | 340 | Settings::checkDirectory(); |
338 | 341 | ||
339 | Config *conf = new Config( getFileName(), Config::File ); | 342 | Config *conf = new Config( getFileName(), Config::File ); |
340 | conf->setGroup( "SMTP Account" ); | 343 | conf->setGroup( "SMTP Account" ); |
341 | conf->writeEntry( "Account", accountName ); | 344 | conf->writeEntry( "Account", accountName ); |
342 | conf->writeEntry( "Server", server ); | 345 | conf->writeEntry( "Server", server ); |
343 | conf->writeEntry( "Port", port ); | 346 | conf->writeEntry( "Port", port ); |
344 | conf->writeEntry( "SSL", ssl ); | 347 | conf->writeEntry( "SSL", ssl ); |
348 | conf->writeEntry( "ConnectionType", connectionType ); | ||
345 | conf->writeEntry( "Login", login ); | 349 | conf->writeEntry( "Login", login ); |
346 | conf->writeEntry( "User", user ); | 350 | conf->writeEntry( "User", user ); |
347 | conf->writeEntryCrypt( "Password", password ); | 351 | conf->writeEntryCrypt( "Password", password ); |
348 | conf->write(); | 352 | conf->write(); |
349 | delete conf; | 353 | delete conf; |
350 | } | 354 | } |
351 | 355 | ||
352 | 356 | ||
353 | QString SMTPaccount::getFileName() | 357 | QString SMTPaccount::getFileName() |
354 | { | 358 | { |
355 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file; | 359 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/smtp-" + file; |
356 | } | 360 | } |