author | zautrix <zautrix> | 2004-09-10 15:30:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 15:30:01 (UTC) |
commit | 4af018e98a29e859df1b28a437c4965bb9676394 (patch) (unidiff) | |
tree | ac71fa15fdd2eca263730493de378482952d8c80 /kmicromail/libmailwrapper/settings.cpp | |
parent | 14056eb4ec076bc243dcb9f600999eb437fb8afd (diff) | |
download | kdepimpi-4af018e98a29e859df1b28a437c4965bb9676394.zip kdepimpi-4af018e98a29e859df1b28a437c4965bb9676394.tar.gz kdepimpi-4af018e98a29e859df1b28a437c4965bb9676394.tar.bz2 |
path fixes for kopiemail
Diffstat (limited to 'kmicromail/libmailwrapper/settings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index bdb2a25..b0a539e 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -19,25 +19,25 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | Settings::Settings() | 21 | Settings::Settings() |
22 | : QObject() | 22 | : QObject() |
23 | { | 23 | { |
24 | updateAccounts(); | 24 | updateAccounts(); |
25 | } | 25 | } |
26 | 26 | ||
27 | void Settings::checkDirectory() | 27 | void Settings::checkDirectory() |
28 | { | 28 | { |
29 | qDebug("Settings::checkDirectory() "); | 29 | qDebug("Settings::checkDirectory() "); |
30 | return; | 30 | return; |
31 | locateLocal("data", "kmicromail" ); | 31 | locateLocal("data", "kopiemail" ); |
32 | /* | 32 | /* |
33 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 33 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
34 | system( "mkdir -p $HOME/Applications/opiemail" ); | 34 | system( "mkdir -p $HOME/Applications/opiemail" ); |
35 | qDebug("$HOME/Applications/opiemail created "); | 35 | qDebug("$HOME/Applications/opiemail created "); |
36 | } | 36 | } |
37 | */ | 37 | */ |
38 | } | 38 | } |
39 | 39 | ||
40 | QList<Account> Settings::getAccounts() | 40 | QList<Account> Settings::getAccounts() |
41 | { | 41 | { |
42 | return accounts; | 42 | return accounts; |
43 | } | 43 | } |
@@ -47,25 +47,25 @@ void Settings::addAccount( Account *account ) | |||
47 | accounts.append( account ); | 47 | accounts.append( account ); |
48 | } | 48 | } |
49 | 49 | ||
50 | void Settings::delAccount( Account *account ) | 50 | void Settings::delAccount( Account *account ) |
51 | { | 51 | { |
52 | accounts.remove( account ); | 52 | accounts.remove( account ); |
53 | account->remove(); | 53 | account->remove(); |
54 | } | 54 | } |
55 | 55 | ||
56 | void Settings::updateAccounts() | 56 | void Settings::updateAccounts() |
57 | { | 57 | { |
58 | accounts.clear(); | 58 | accounts.clear(); |
59 | QDir dir( locateLocal("data", "kmicromail" ) ); | 59 | QDir dir( locateLocal("data", "kopiemail" ) ); |
60 | QStringList::Iterator it; | 60 | QStringList::Iterator it; |
61 | 61 | ||
62 | QStringList imap = dir.entryList( "imap-*" ); | 62 | QStringList imap = dir.entryList( "imap-*" ); |
63 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 63 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
64 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 64 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
65 | accounts.append( account ); | 65 | accounts.append( account ); |
66 | } | 66 | } |
67 | 67 | ||
68 | QStringList pop3 = dir.entryList( "pop3-*" ); | 68 | QStringList pop3 = dir.entryList( "pop3-*" ); |
69 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 69 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
70 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 70 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
71 | accounts.append( account ); | 71 | accounts.append( account ); |
@@ -139,25 +139,25 @@ IMAPaccount::IMAPaccount( QString filename ) | |||
139 | accountName = "New IMAP Account"; | 139 | accountName = "New IMAP Account"; |
140 | ssl = false; | 140 | ssl = false; |
141 | connectionType = 1; | 141 | connectionType = 1; |
142 | type = MAILLIB::A_IMAP; | 142 | type = MAILLIB::A_IMAP; |
143 | port = IMAP_PORT; | 143 | port = IMAP_PORT; |
144 | } | 144 | } |
145 | 145 | ||
146 | QString IMAPaccount::getUniqueFileName() | 146 | QString IMAPaccount::getUniqueFileName() |
147 | { | 147 | { |
148 | int num = 0; | 148 | int num = 0; |
149 | QString unique; | 149 | QString unique; |
150 | 150 | ||
151 | QDir dir( locateLocal("data", "kmicromail" ) ); | 151 | QDir dir( locateLocal("data", "kopiemail" ) ); |
152 | 152 | ||
153 | QStringList imap = dir.entryList( "imap-*" ); | 153 | QStringList imap = dir.entryList( "imap-*" ); |
154 | do { | 154 | do { |
155 | unique.setNum( num++ ); | 155 | unique.setNum( num++ ); |
156 | } while ( imap.contains( "imap-" + unique ) > 0 ); | 156 | } while ( imap.contains( "imap-" + unique ) > 0 ); |
157 | 157 | ||
158 | return unique; | 158 | return unique; |
159 | } | 159 | } |
160 | 160 | ||
161 | void IMAPaccount::read() | 161 | void IMAPaccount::read() |
162 | { | 162 | { |
163 | Config *conf = new Config( getFileName(), Config::File ); | 163 | Config *conf = new Config( getFileName(), Config::File ); |
@@ -194,25 +194,25 @@ void IMAPaccount::save() | |||
194 | conf->writeEntry( "ConnectionType", connectionType ); | 194 | conf->writeEntry( "ConnectionType", connectionType ); |
195 | conf->writeEntry( "User", user ); | 195 | conf->writeEntry( "User", user ); |
196 | conf->writeEntryCrypt( "Password", password ); | 196 | conf->writeEntryCrypt( "Password", password ); |
197 | conf->writeEntry( "MailPrefix",prefix); | 197 | conf->writeEntry( "MailPrefix",prefix); |
198 | conf->writeEntry( "Offline",offline); | 198 | conf->writeEntry( "Offline",offline); |
199 | conf->write(); | 199 | conf->write(); |
200 | delete conf; | 200 | delete conf; |
201 | } | 201 | } |
202 | 202 | ||
203 | 203 | ||
204 | QString IMAPaccount::getFileName() | 204 | QString IMAPaccount::getFileName() |
205 | { | 205 | { |
206 | return locateLocal("data", "kmicromail" ) +"/imap-" + file; | 206 | return locateLocal("data", "kopiemail" ) +"/imap-" + file; |
207 | } | 207 | } |
208 | 208 | ||
209 | POP3account::POP3account() | 209 | POP3account::POP3account() |
210 | : Account() | 210 | : Account() |
211 | { | 211 | { |
212 | file = POP3account::getUniqueFileName(); | 212 | file = POP3account::getUniqueFileName(); |
213 | accountName = "New POP3 Account"; | 213 | accountName = "New POP3 Account"; |
214 | ssl = false; | 214 | ssl = false; |
215 | connectionType = 1; | 215 | connectionType = 1; |
216 | type = MAILLIB::A_POP3; | 216 | type = MAILLIB::A_POP3; |
217 | port = POP3_PORT; | 217 | port = POP3_PORT; |
218 | } | 218 | } |
@@ -224,25 +224,25 @@ POP3account::POP3account( QString filename ) | |||
224 | accountName = "New POP3 Account"; | 224 | accountName = "New POP3 Account"; |
225 | ssl = false; | 225 | ssl = false; |
226 | connectionType = 1; | 226 | connectionType = 1; |
227 | type = MAILLIB::A_POP3; | 227 | type = MAILLIB::A_POP3; |
228 | port = POP3_PORT; | 228 | port = POP3_PORT; |
229 | } | 229 | } |
230 | 230 | ||
231 | QString POP3account::getUniqueFileName() | 231 | QString POP3account::getUniqueFileName() |
232 | { | 232 | { |
233 | int num = 0; | 233 | int num = 0; |
234 | QString unique; | 234 | QString unique; |
235 | 235 | ||
236 | QDir dir( locateLocal("data", "kmicromail" ) ); | 236 | QDir dir( locateLocal("data", "kopiemail" ) ); |
237 | 237 | ||
238 | QStringList imap = dir.entryList( "pop3-*" ); | 238 | QStringList imap = dir.entryList( "pop3-*" ); |
239 | do { | 239 | do { |
240 | unique.setNum( num++ ); | 240 | unique.setNum( num++ ); |
241 | } while ( imap.contains( "pop3-" + unique ) > 0 ); | 241 | } while ( imap.contains( "pop3-" + unique ) > 0 ); |
242 | 242 | ||
243 | return unique; | 243 | return unique; |
244 | } | 244 | } |
245 | 245 | ||
246 | void POP3account::read() | 246 | void POP3account::read() |
247 | { | 247 | { |
248 | Config *conf = new Config( getFileName(), Config::File ); | 248 | Config *conf = new Config( getFileName(), Config::File ); |
@@ -270,25 +270,25 @@ void POP3account::save() | |||
270 | conf->writeEntry( "SSL", ssl ); | 270 | conf->writeEntry( "SSL", ssl ); |
271 | conf->writeEntry( "ConnectionType", connectionType ); | 271 | conf->writeEntry( "ConnectionType", connectionType ); |
272 | conf->writeEntry( "User", user ); | 272 | conf->writeEntry( "User", user ); |
273 | conf->writeEntryCrypt( "Password", password ); | 273 | conf->writeEntryCrypt( "Password", password ); |
274 | conf->writeEntry( "Offline",offline); | 274 | conf->writeEntry( "Offline",offline); |
275 | conf->write(); | 275 | conf->write(); |
276 | delete conf; | 276 | delete conf; |
277 | } | 277 | } |
278 | 278 | ||
279 | 279 | ||
280 | QString POP3account::getFileName() | 280 | QString POP3account::getFileName() |
281 | { | 281 | { |
282 | return locateLocal("data", "kmicromail" ) +"/pop3-" + file; | 282 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; |
283 | } | 283 | } |
284 | 284 | ||
285 | SMTPaccount::SMTPaccount() | 285 | SMTPaccount::SMTPaccount() |
286 | : Account() | 286 | : Account() |
287 | { | 287 | { |
288 | file = SMTPaccount::getUniqueFileName(); | 288 | file = SMTPaccount::getUniqueFileName(); |
289 | accountName = "New SMTP Account"; | 289 | accountName = "New SMTP Account"; |
290 | ssl = false; | 290 | ssl = false; |
291 | connectionType = 1; | 291 | connectionType = 1; |
292 | login = false; | 292 | login = false; |
293 | useCC = false; | 293 | useCC = false; |
294 | useBCC = false; | 294 | useBCC = false; |
@@ -305,25 +305,25 @@ SMTPaccount::SMTPaccount( QString filename ) | |||
305 | ssl = false; | 305 | ssl = false; |
306 | connectionType = 1; | 306 | connectionType = 1; |
307 | login = false; | 307 | login = false; |
308 | type = MAILLIB::A_SMTP; | 308 | type = MAILLIB::A_SMTP; |
309 | port = SMTP_PORT; | 309 | port = SMTP_PORT; |
310 | } | 310 | } |
311 | 311 | ||
312 | QString SMTPaccount::getUniqueFileName() | 312 | QString SMTPaccount::getUniqueFileName() |
313 | { | 313 | { |
314 | int num = 0; | 314 | int num = 0; |
315 | QString unique; | 315 | QString unique; |
316 | 316 | ||
317 | QDir dir( locateLocal("data", "kmicromail" ) ); | 317 | QDir dir( locateLocal("data", "kopiemail" ) ); |
318 | 318 | ||
319 | QStringList imap = dir.entryList( "smtp-*" ); | 319 | QStringList imap = dir.entryList( "smtp-*" ); |
320 | do { | 320 | do { |
321 | unique.setNum( num++ ); | 321 | unique.setNum( num++ ); |
322 | } while ( imap.contains( "smtp-" + unique ) > 0 ); | 322 | } while ( imap.contains( "smtp-" + unique ) > 0 ); |
323 | 323 | ||
324 | return unique; | 324 | return unique; |
325 | } | 325 | } |
326 | 326 | ||
327 | void SMTPaccount::read() | 327 | void SMTPaccount::read() |
328 | { | 328 | { |
329 | Config *conf = new Config( getFileName(), Config::File ); | 329 | Config *conf = new Config( getFileName(), Config::File ); |
@@ -351,25 +351,25 @@ void SMTPaccount::save() | |||
351 | conf->writeEntry( "SSL", ssl ); | 351 | conf->writeEntry( "SSL", ssl ); |
352 | conf->writeEntry( "ConnectionType", connectionType ); | 352 | conf->writeEntry( "ConnectionType", connectionType ); |
353 | conf->writeEntry( "Login", login ); | 353 | conf->writeEntry( "Login", login ); |
354 | conf->writeEntry( "User", user ); | 354 | conf->writeEntry( "User", user ); |
355 | conf->writeEntryCrypt( "Password", password ); | 355 | conf->writeEntryCrypt( "Password", password ); |
356 | conf->write(); | 356 | conf->write(); |
357 | delete conf; | 357 | delete conf; |
358 | } | 358 | } |
359 | 359 | ||
360 | 360 | ||
361 | QString SMTPaccount::getFileName() | 361 | QString SMTPaccount::getFileName() |
362 | { | 362 | { |
363 | return locateLocal("data", "kmicromail" ) +"/smtp-" + file; | 363 | return locateLocal("data", "kopiemail" ) +"/smtp-" + file; |
364 | } | 364 | } |
365 | 365 | ||
366 | NNTPaccount::NNTPaccount() | 366 | NNTPaccount::NNTPaccount() |
367 | : Account() | 367 | : Account() |
368 | { | 368 | { |
369 | file = NNTPaccount::getUniqueFileName(); | 369 | file = NNTPaccount::getUniqueFileName(); |
370 | accountName = "New NNTP Account"; | 370 | accountName = "New NNTP Account"; |
371 | ssl = false; | 371 | ssl = false; |
372 | login = false; | 372 | login = false; |
373 | type = MAILLIB::A_NNTP; | 373 | type = MAILLIB::A_NNTP; |
374 | port = NNTP_PORT; | 374 | port = NNTP_PORT; |
375 | } | 375 | } |
@@ -381,25 +381,25 @@ NNTPaccount::NNTPaccount( QString filename ) | |||
381 | accountName = "New NNTP Account"; | 381 | accountName = "New NNTP Account"; |
382 | ssl = false; | 382 | ssl = false; |
383 | login = false; | 383 | login = false; |
384 | type = MAILLIB::A_NNTP; | 384 | type = MAILLIB::A_NNTP; |
385 | port = NNTP_PORT; | 385 | port = NNTP_PORT; |
386 | } | 386 | } |
387 | 387 | ||
388 | QString NNTPaccount::getUniqueFileName() | 388 | QString NNTPaccount::getUniqueFileName() |
389 | { | 389 | { |
390 | int num = 0; | 390 | int num = 0; |
391 | QString unique; | 391 | QString unique; |
392 | 392 | ||
393 | QDir dir( locateLocal("data", "kmicromail" ) ); | 393 | QDir dir( locateLocal("data", "kopiemail" ) ); |
394 | 394 | ||
395 | QStringList imap = dir.entryList( "nntp-*" ); | 395 | QStringList imap = dir.entryList( "nntp-*" ); |
396 | do { | 396 | do { |
397 | unique.setNum( num++ ); | 397 | unique.setNum( num++ ); |
398 | } while ( imap.contains( "nntp-" + unique ) > 0 ); | 398 | } while ( imap.contains( "nntp-" + unique ) > 0 ); |
399 | 399 | ||
400 | return unique; | 400 | return unique; |
401 | } | 401 | } |
402 | 402 | ||
403 | void NNTPaccount::read() | 403 | void NNTPaccount::read() |
404 | { | 404 | { |
405 | Config *conf = new Config( getFileName(), Config::File ); | 405 | Config *conf = new Config( getFileName(), Config::File ); |
@@ -427,14 +427,14 @@ void NNTPaccount::save() | |||
427 | conf->writeEntry( "SSL", ssl ); | 427 | conf->writeEntry( "SSL", ssl ); |
428 | conf->writeEntry( "Login", login ); | 428 | conf->writeEntry( "Login", login ); |
429 | conf->writeEntry( "User", user ); | 429 | conf->writeEntry( "User", user ); |
430 | conf->writeEntryCrypt( "Password", password ); | 430 | conf->writeEntryCrypt( "Password", password ); |
431 | conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); | 431 | conf->writeEntry( "Subscribed" , subscribedGroups, ',' ); |
432 | conf->write(); | 432 | conf->write(); |
433 | delete conf; | 433 | delete conf; |
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
437 | QString NNTPaccount::getFileName() | 437 | QString NNTPaccount::getFileName() |
438 | { | 438 | { |
439 | return locateLocal("data", "kmicromail" ) +"/nntp-" + file; | 439 | return locateLocal("data", "kopiemail" ) +"/nntp-" + file; |
440 | } | 440 | } |