author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/net/mail/libmailwrapper/settings.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/net/mail/libmailwrapper/settings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 2c81963..de36eeb 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -21,17 +21,17 @@ Settings::Settings() | |||
21 | { | 21 | { |
22 | updateAccounts(); | 22 | updateAccounts(); |
23 | } | 23 | } |
24 | 24 | ||
25 | void Settings::checkDirectory() | 25 | void Settings::checkDirectory() |
26 | { | 26 | { |
27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
28 | system( "mkdir -p $HOME/Applications/opiemail" ); | 28 | system( "mkdir -p $HOME/Applications/opiemail" ); |
29 | qDebug( "$HOME/Applications/opiemail created" ); | 29 | odebug << "$HOME/Applications/opiemail created" << oendl; |
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | QList<Account> Settings::getAccounts() | 33 | QList<Account> Settings::getAccounts() |
34 | { | 34 | { |
35 | return accounts; | 35 | return accounts; |
36 | } | 36 | } |
37 | 37 | ||
@@ -49,38 +49,38 @@ void Settings::delAccount( Account *account ) | |||
49 | void Settings::updateAccounts() | 49 | void Settings::updateAccounts() |
50 | { | 50 | { |
51 | accounts.clear(); | 51 | accounts.clear(); |
52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
53 | QStringList::Iterator it; | 53 | QStringList::Iterator it; |
54 | 54 | ||
55 | QStringList imap = dir.entryList( "imap-*" ); | 55 | QStringList imap = dir.entryList( "imap-*" ); |
56 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 56 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
57 | qDebug( "Added IMAP account" ); | 57 | odebug << "Added IMAP account" << oendl; |
58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
59 | accounts.append( account ); | 59 | accounts.append( account ); |
60 | } | 60 | } |
61 | 61 | ||
62 | QStringList pop3 = dir.entryList( "pop3-*" ); | 62 | QStringList pop3 = dir.entryList( "pop3-*" ); |
63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
64 | qDebug( "Added POP account" ); | 64 | odebug << "Added POP account" << oendl; |
65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
66 | accounts.append( account ); | 66 | accounts.append( account ); |
67 | } | 67 | } |
68 | 68 | ||
69 | QStringList smtp = dir.entryList( "smtp-*" ); | 69 | QStringList smtp = dir.entryList( "smtp-*" ); |
70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 70 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
71 | qDebug( "Added SMTP account" ); | 71 | odebug << "Added SMTP account" << oendl; |
72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 72 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
73 | accounts.append( account ); | 73 | accounts.append( account ); |
74 | } | 74 | } |
75 | 75 | ||
76 | QStringList nntp = dir.entryList( "nntp-*" ); | 76 | QStringList nntp = dir.entryList( "nntp-*" ); |
77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 77 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
78 | qDebug( "Added NNTP account" ); | 78 | odebug << "Added NNTP account" << oendl; |
79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 79 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
80 | accounts.append( account ); | 80 | accounts.append( account ); |
81 | } | 81 | } |
82 | 82 | ||
83 | readAccounts(); | 83 | readAccounts(); |
84 | } | 84 | } |
85 | 85 | ||
86 | void Settings::saveAccounts() | 86 | void Settings::saveAccounts() |
@@ -174,17 +174,17 @@ void IMAPaccount::read() | |||
174 | prefix = conf->readEntry("MailPrefix",""); | 174 | prefix = conf->readEntry("MailPrefix",""); |
175 | if (prefix.isNull()) prefix = ""; | 175 | if (prefix.isNull()) prefix = ""; |
176 | offline = conf->readBoolEntry("Offline",false); | 176 | offline = conf->readBoolEntry("Offline",false); |
177 | delete conf; | 177 | delete conf; |
178 | } | 178 | } |
179 | 179 | ||
180 | void IMAPaccount::save() | 180 | void IMAPaccount::save() |
181 | { | 181 | { |
182 | qDebug( "saving " + getFileName() ); | 182 | odebug << "saving " + getFileName() << oendl; |
183 | Settings::checkDirectory(); | 183 | Settings::checkDirectory(); |
184 | 184 | ||
185 | Config *conf = new Config( getFileName(), Config::File ); | 185 | Config *conf = new Config( getFileName(), Config::File ); |
186 | conf->setGroup( "IMAP Account" ); | 186 | conf->setGroup( "IMAP Account" ); |
187 | conf->writeEntry( "Account", accountName ); | 187 | conf->writeEntry( "Account", accountName ); |
188 | conf->writeEntry( "Server", server ); | 188 | conf->writeEntry( "Server", server ); |
189 | conf->writeEntry( "Port", port ); | 189 | conf->writeEntry( "Port", port ); |
190 | conf->writeEntry( "SSL", ssl ); | 190 | conf->writeEntry( "SSL", ssl ); |
@@ -252,17 +252,17 @@ void POP3account::read() | |||
252 | user = conf->readEntry( "User" ); | 252 | user = conf->readEntry( "User" ); |
253 | password = conf->readEntryCrypt( "Password" ); | 253 | password = conf->readEntryCrypt( "Password" ); |
254 | offline = conf->readBoolEntry("Offline",false); | 254 | offline = conf->readBoolEntry("Offline",false); |
255 | delete conf; | 255 | delete conf; |
256 | } | 256 | } |
257 | 257 | ||
258 | void POP3account::save() | 258 | void POP3account::save() |
259 | { | 259 | { |
260 | qDebug( "saving " + getFileName() ); | 260 | odebug << "saving " + getFileName() << oendl; |
261 | Settings::checkDirectory(); | 261 | Settings::checkDirectory(); |
262 | 262 | ||
263 | Config *conf = new Config( getFileName(), Config::File ); | 263 | Config *conf = new Config( getFileName(), Config::File ); |
264 | conf->setGroup( "POP3 Account" ); | 264 | conf->setGroup( "POP3 Account" ); |
265 | conf->writeEntry( "Account", accountName ); | 265 | conf->writeEntry( "Account", accountName ); |
266 | conf->writeEntry( "Server", server ); | 266 | conf->writeEntry( "Server", server ); |
267 | conf->writeEntry( "Port", port ); | 267 | conf->writeEntry( "Port", port ); |
268 | conf->writeEntry( "SSL", ssl ); | 268 | conf->writeEntry( "SSL", ssl ); |
@@ -334,17 +334,17 @@ void SMTPaccount::read() | |||
334 | login = conf->readBoolEntry( "Login" ); | 334 | login = conf->readBoolEntry( "Login" ); |
335 | user = conf->readEntry( "User" ); | 335 | user = conf->readEntry( "User" ); |
336 | password = conf->readEntryCrypt( "Password" ); | 336 | password = conf->readEntryCrypt( "Password" ); |
337 | delete conf; | 337 | delete conf; |
338 | } | 338 | } |
339 | 339 | ||
340 | void SMTPaccount::save() | 340 | void SMTPaccount::save() |
341 | { | 341 | { |
342 | qDebug( "saving " + getFileName() ); | 342 | odebug << "saving " + getFileName() << oendl; |
343 | Settings::checkDirectory(); | 343 | Settings::checkDirectory(); |
344 | 344 | ||
345 | Config *conf = new Config( getFileName(), Config::File ); | 345 | Config *conf = new Config( getFileName(), Config::File ); |
346 | conf->setGroup( "SMTP Account" ); | 346 | conf->setGroup( "SMTP Account" ); |
347 | conf->writeEntry( "Account", accountName ); | 347 | conf->writeEntry( "Account", accountName ); |
348 | conf->writeEntry( "Server", server ); | 348 | conf->writeEntry( "Server", server ); |
349 | conf->writeEntry( "Port", port ); | 349 | conf->writeEntry( "Port", port ); |
350 | conf->writeEntry( "SSL", ssl ); | 350 | conf->writeEntry( "SSL", ssl ); |
@@ -411,17 +411,17 @@ void NNTPaccount::read() | |||
411 | user = conf->readEntry( "User" ); | 411 | user = conf->readEntry( "User" ); |
412 | password = conf->readEntryCrypt( "Password" ); | 412 | password = conf->readEntryCrypt( "Password" ); |
413 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); | 413 | subscribedGroups = conf->readListEntry( "Subscribed", ',' ); |
414 | delete conf; | 414 | delete conf; |
415 | } | 415 | } |
416 | 416 | ||
417 | void NNTPaccount::save() | 417 | void NNTPaccount::save() |
418 | { | 418 | { |
419 | qDebug( "saving " + getFileName() ); | 419 | odebug << "saving " + getFileName() << oendl; |
420 | Settings::checkDirectory(); | 420 | Settings::checkDirectory(); |
421 | 421 | ||
422 | Config *conf = new Config( getFileName(), Config::File ); | 422 | Config *conf = new Config( getFileName(), Config::File ); |
423 | conf->setGroup( "NNTP Account" ); | 423 | conf->setGroup( "NNTP Account" ); |
424 | conf->writeEntry( "Account", accountName ); | 424 | conf->writeEntry( "Account", accountName ); |
425 | conf->writeEntry( "Server", server ); | 425 | conf->writeEntry( "Server", server ); |
426 | conf->writeEntry( "Port", port ); | 426 | conf->writeEntry( "Port", port ); |
427 | conf->writeEntry( "SSL", ssl ); | 427 | conf->writeEntry( "SSL", ssl ); |