Diffstat (limited to 'kmicromail/libmailwrapper/settings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 9436d43..fc01528 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -1,101 +1,101 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | #include <qtextcodec.h> | 4 | #include <qtextcodec.h> |
5 | #include <qtextstream.h> | 5 | #include <q3textstream.h> |
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | 7 | ||
8 | //#include <opie2/odebug.h> | 8 | //#include <opie2/odebug.h> |
9 | #include <kconfig.h> | 9 | #include <kconfig.h> |
10 | 10 | ||
11 | #include <kstandarddirs.h> | 11 | #include <kstandarddirs.h> |
12 | #include "settings.h" | 12 | #include "settings.h" |
13 | //#include "defines.h" | 13 | //#include "defines.h" |
14 | 14 | ||
15 | #define IMAP_PORT "143" | 15 | #define IMAP_PORT "143" |
16 | #define IMAP_SSL_PORT "993" | 16 | #define IMAP_SSL_PORT "993" |
17 | #define SMTP_PORT "25" | 17 | #define SMTP_PORT "25" |
18 | #define SMTP_SSL_PORT "465" | 18 | #define SMTP_SSL_PORT "465" |
19 | #define POP3_PORT "110" | 19 | #define POP3_PORT "110" |
20 | #define POP3_SSL_PORT "995" | 20 | #define POP3_SSL_PORT "995" |
21 | #define NNTP_PORT "119" | 21 | #define NNTP_PORT "119" |
22 | #define NNTP_SSL_PORT "563" | 22 | #define NNTP_SSL_PORT "563" |
23 | 23 | ||
24 | 24 | ||
25 | Settings::Settings() | 25 | Settings::Settings() |
26 | : QObject() | 26 | : QObject() |
27 | { | 27 | { |
28 | accounts.setAutoDelete( true ); ; | 28 | accounts.setAutoDelete( true ); ; |
29 | updateAccounts(); | 29 | updateAccounts(); |
30 | //qDebug("++++++++++++++++++new settings "); | 30 | //qDebug("++++++++++++++++++new settings "); |
31 | } | 31 | } |
32 | 32 | ||
33 | void Settings::checkDirectory() | 33 | void Settings::checkDirectory() |
34 | { | 34 | { |
35 | return; | 35 | return; |
36 | locateLocal("data", "kopiemail" ); | 36 | locateLocal("data", "kopiemail" ); |
37 | /* | 37 | /* |
38 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 38 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
39 | system( "mkdir -p $HOME/Applications/opiemail" ); | 39 | system( "mkdir -p $HOME/Applications/opiemail" ); |
40 | qDebug("$HOME/Applications/opiemail created "); | 40 | qDebug("$HOME/Applications/opiemail created "); |
41 | } | 41 | } |
42 | */ | 42 | */ |
43 | } | 43 | } |
44 | 44 | ||
45 | QList<Account> Settings::getAccounts() | 45 | QList<Account> Settings::getAccounts() |
46 | { | 46 | { |
47 | return accounts; | 47 | return accounts; |
48 | } | 48 | } |
49 | 49 | ||
50 | void Settings::addAccount( Account *account ) | 50 | void Settings::addAccount( Account *account ) |
51 | { | 51 | { |
52 | accounts.append( account ); | 52 | accounts.append( account ); |
53 | } | 53 | } |
54 | 54 | ||
55 | void Settings::delAccount( Account *account ) | 55 | void Settings::delAccount( Account *account ) |
56 | { | 56 | { |
57 | account->remove(); | 57 | account->remove(); |
58 | accounts.remove( account ); | 58 | accounts.remove( account ); |
59 | } | 59 | } |
60 | 60 | ||
61 | void Settings::updateAccounts() | 61 | void Settings::updateAccounts() |
62 | { | 62 | { |
63 | accounts.clear(); | 63 | accounts.clear(); |
64 | QDir dir( locateLocal("data", "kopiemail" ) ); | 64 | QDir dir( locateLocal("data", "kopiemail" ) ); |
65 | QStringList::Iterator it; | 65 | QStringList::Iterator it; |
66 | 66 | ||
67 | QStringList imap = dir.entryList( "imap-*" ); | 67 | QStringList imap = dir.entryList( "imap-*" ); |
68 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 68 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
69 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 69 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
70 | accounts.append( account ); | 70 | accounts.append( account ); |
71 | } | 71 | } |
72 | 72 | ||
73 | QStringList pop3 = dir.entryList( "pop3-*" ); | 73 | QStringList pop3 = dir.entryList( "pop3-*" ); |
74 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 74 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
75 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 75 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
76 | accounts.append( account ); | 76 | accounts.append( account ); |
77 | } | 77 | } |
78 | 78 | ||
79 | QStringList smtp = dir.entryList( "smtp-*" ); | 79 | QStringList smtp = dir.entryList( "smtp-*" ); |
80 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 80 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
81 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 81 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
82 | accounts.append( account ); | 82 | accounts.append( account ); |
83 | } | 83 | } |
84 | 84 | ||
85 | QStringList nntp = dir.entryList( "nntp-*" ); | 85 | QStringList nntp = dir.entryList( "nntp-*" ); |
86 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 86 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
87 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 87 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
88 | accounts.append( account ); | 88 | accounts.append( account ); |
89 | } | 89 | } |
90 | 90 | ||
91 | readAccounts(); | 91 | readAccounts(); |
92 | } | 92 | } |
93 | 93 | ||
94 | void Settings::saveAccounts() | 94 | void Settings::saveAccounts() |
95 | { | 95 | { |
96 | checkDirectory(); | 96 | checkDirectory(); |
97 | Account *it; | 97 | Account *it; |
98 | 98 | ||
99 | for ( it = accounts.first(); it; it = accounts.next() ) { | 99 | for ( it = accounts.first(); it; it = accounts.next() ) { |
100 | it->save(); | 100 | it->save(); |
101 | } | 101 | } |
@@ -283,220 +283,220 @@ QString POP3account::getUniqueFileName() | |||
283 | 283 | ||
284 | QStringList imap = dir.entryList( "pop3-*" ); | 284 | QStringList imap = dir.entryList( "pop3-*" ); |
285 | do { | 285 | do { |
286 | unique.setNum( num++ ); | 286 | unique.setNum( num++ ); |
287 | } while ( imap.contains( "pop3-" + unique ) > 0 ); | 287 | } while ( imap.contains( "pop3-" + unique ) > 0 ); |
288 | 288 | ||
289 | return unique; | 289 | return unique; |
290 | } | 290 | } |
291 | 291 | ||
292 | void POP3account::read() | 292 | void POP3account::read() |
293 | { | 293 | { |
294 | KConfig *conf = new KConfig( getFileName()); | 294 | KConfig *conf = new KConfig( getFileName()); |
295 | conf->setGroup( "POP3 Account" ); | 295 | conf->setGroup( "POP3 Account" ); |
296 | accountName = conf->readEntry( "Account" ); | 296 | accountName = conf->readEntry( "Account" ); |
297 | server = conf->readEntry( "Server" ); | 297 | server = conf->readEntry( "Server" ); |
298 | port = conf->readEntry( "Port" ); | 298 | port = conf->readEntry( "Port" ); |
299 | ssl = conf->readBoolEntry( "SSL" ); | 299 | ssl = conf->readBoolEntry( "SSL" ); |
300 | connectionType = conf->readNumEntry( "ConnectionType" ); | 300 | connectionType = conf->readNumEntry( "ConnectionType" ); |
301 | user = conf->readEntry( "User" ); | 301 | user = conf->readEntry( "User" ); |
302 | //password = conf->readEntryCrypt( "Password" ); | 302 | //password = conf->readEntryCrypt( "Password" ); |
303 | setPasswordList( conf->readListEntry( "FolderHistory")); | 303 | setPasswordList( conf->readListEntry( "FolderHistory")); |
304 | offline = conf->readBoolEntry("Offline",false); | 304 | offline = conf->readBoolEntry("Offline",false); |
305 | localFolder = conf->readEntry( "LocalFolder" ); | 305 | localFolder = conf->readEntry( "LocalFolder" ); |
306 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); | 306 | maxMailSize = conf->readNumEntry( "MaxSize",0 ); |
307 | int lf = conf->readNumEntry( "LastFetch",0 ); | 307 | int lf = conf->readNumEntry( "LastFetch",0 ); |
308 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | 308 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); |
309 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); | 309 | leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); |
310 | lastFetch = dt.addSecs( lf ); | 310 | lastFetch = dt.addSecs( lf ); |
311 | delete conf; | 311 | delete conf; |
312 | } | 312 | } |
313 | 313 | ||
314 | void POP3account::save() | 314 | void POP3account::save() |
315 | { | 315 | { |
316 | Settings::checkDirectory(); | 316 | Settings::checkDirectory(); |
317 | 317 | ||
318 | KConfig *conf = new KConfig( getFileName() ); | 318 | KConfig *conf = new KConfig( getFileName() ); |
319 | conf->setGroup( "POP3 Account" ); | 319 | conf->setGroup( "POP3 Account" ); |
320 | conf->writeEntry( "Account", accountName ); | 320 | conf->writeEntry( "Account", accountName ); |
321 | conf->writeEntry( "Server", server ); | 321 | conf->writeEntry( "Server", server ); |
322 | conf->writeEntry( "Port", port ); | 322 | conf->writeEntry( "Port", port ); |
323 | conf->writeEntry( "SSL", ssl ); | 323 | conf->writeEntry( "SSL", ssl ); |
324 | conf->writeEntry( "ConnectionType", connectionType ); | 324 | conf->writeEntry( "ConnectionType", connectionType ); |
325 | conf->writeEntry( "User", user ); | 325 | conf->writeEntry( "User", user ); |
326 | //conf->writeEntryCrypt( "Password", password ); | 326 | //conf->writeEntryCrypt( "Password", password ); |
327 | conf->writeEntry( "FolderHistory",getPasswordList() ); | 327 | conf->writeEntry( "FolderHistory",getPasswordList() ); |
328 | conf->writeEntry( "Offline",offline); | 328 | conf->writeEntry( "Offline",offline); |
329 | conf->writeEntry( "LocalFolder", localFolder ); | 329 | conf->writeEntry( "LocalFolder", localFolder ); |
330 | conf->writeEntry( "MaxSize", maxMailSize ); | 330 | conf->writeEntry( "MaxSize", maxMailSize ); |
331 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); | 331 | QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); |
332 | int lf = dt.secsTo ( lastFetch ); | 332 | int lf = dt.secsTo ( lastFetch ); |
333 | conf->writeEntry( "LastFetch", lf ); | 333 | conf->writeEntry( "LastFetch", lf ); |
334 | conf->writeEntry( "LeaveOnServer", leaveOnServer); | 334 | conf->writeEntry( "LeaveOnServer", leaveOnServer); |
335 | conf->sync(); | 335 | conf->sync(); |
336 | delete conf; | 336 | delete conf; |
337 | } | 337 | } |
338 | 338 | ||
339 | 339 | ||
340 | QString POP3account::getFileName() | 340 | QString POP3account::getFileName() |
341 | { | 341 | { |
342 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; | 342 | return locateLocal("data", "kopiemail" ) +"/pop3-" + file; |
343 | } | 343 | } |
344 | 344 | ||
345 | SMTPaccount::SMTPaccount() | 345 | SMTPaccount::SMTPaccount() |
346 | : Account() | 346 | : Account() |
347 | { | 347 | { |
348 | file = SMTPaccount::getUniqueFileName(); | 348 | file = SMTPaccount::getUniqueFileName(); |
349 | accountName = "New SMTP Account"; | 349 | accountName = "New SMTP Account"; |
350 | ssl = false; | 350 | ssl = false; |
351 | connectionType = 1; | 351 | connectionType = 1; |
352 | login = false; | 352 | login = false; |
353 | useCC = false; | 353 | useCC = false; |
354 | useBCC = false; | 354 | useBCC = false; |
355 | useReply = false; | 355 | useReply = false; |
356 | type = MAILLIB::A_SMTP; | 356 | type = MAILLIB::A_SMTP; |
357 | port = SMTP_PORT; | 357 | port = SMTP_PORT; |
358 | } | 358 | } |
359 | 359 | ||
360 | SMTPaccount::SMTPaccount( QString filename ) | 360 | SMTPaccount::SMTPaccount( QString filename ) |
361 | : Account() | 361 | : Account() |
362 | { | 362 | { |
363 | file = filename; | 363 | file = filename; |
364 | accountName = "New SMTP Account"; | 364 | accountName = "New SMTP Account"; |
365 | ssl = false; | 365 | ssl = false; |
366 | connectionType = 1; | 366 | connectionType = 1; |
367 | login = false; | 367 | login = false; |
368 | type = MAILLIB::A_SMTP; | 368 | type = MAILLIB::A_SMTP; |
369 | port = SMTP_PORT; | 369 | port = SMTP_PORT; |
370 | } | 370 | } |
371 | 371 | ||
372 | QString SMTPaccount::getSignature() | 372 | QString SMTPaccount::getSignature() |
373 | { | 373 | { |
374 | QFileInfo fi ( signature ); | 374 | QFileInfo fi ( signature ); |
375 | if ( ! fi.exists() ) | 375 | if ( ! fi.exists() ) |
376 | return QString(); | 376 | return QString(); |
377 | 377 | ||
378 | QFile file( signature ); | 378 | QFile file( signature ); |
379 | if (!file.open( IO_ReadOnly ) ) { | 379 | if (!file.open( QIODevice::ReadOnly ) ) { |
380 | return QString(); | 380 | return QString(); |
381 | 381 | ||
382 | } | 382 | } |
383 | QTextStream ts( &file ); | 383 | Q3TextStream ts( &file ); |
384 | ts.setCodec( QTextCodec::codecForName("utf8") ); | 384 | ts.setCodec( QTextCodec::codecForName("utf8") ); |
385 | QString text = ts.read(); | 385 | QString text = ts.read(); |
386 | file.close(); | 386 | file.close(); |
387 | 387 | ||
388 | return text; | 388 | return text; |
389 | 389 | ||
390 | } | 390 | } |
391 | void SMTPaccount::setSignature( QString b ) | 391 | void SMTPaccount::setSignature( QString b ) |
392 | { | 392 | { |
393 | 393 | ||
394 | QFileInfo fi ( signature ); | 394 | QFileInfo fi ( signature ); |
395 | if ( ! fi.exists() ) { | 395 | if ( ! fi.exists() ) { |
396 | QString filedir( locateLocal("data", "kopiemail" ) ); | 396 | QString filedir( locateLocal("data", "kopiemail" ) ); |
397 | signature = filedir+ "/" + getAccountName() +".sig"; | 397 | signature = filedir+ "/" + getAccountName() +".sig"; |
398 | qDebug("new sig %s ", signature.latin1()); | 398 | qDebug("new sig %s ", signature.latin1()); |
399 | save(); | 399 | save(); |
400 | } | 400 | } |
401 | QFile fileIn( signature ); | 401 | QFile fileIn( signature ); |
402 | if (!fileIn.open( IO_WriteOnly ) ) { | 402 | if (!fileIn.open( QIODevice::WriteOnly ) ) { |
403 | qDebug("OM: Cannot write signature file %s ", signature.latin1() ); | 403 | qDebug("OM: Cannot write signature file %s ", signature.latin1() ); |
404 | return ; | 404 | return ; |
405 | } | 405 | } |
406 | QTextStream tsIn( &fileIn ); | 406 | Q3TextStream tsIn( &fileIn ); |
407 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 407 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
408 | tsIn << b ; | 408 | tsIn << b ; |
409 | fileIn.close(); | 409 | fileIn.close(); |
410 | } | 410 | } |
411 | QString SMTPaccount::getUniqueFileName() | 411 | QString SMTPaccount::getUniqueFileName() |
412 | { | 412 | { |
413 | int num = 0; | 413 | int num = 0; |
414 | QString unique; | 414 | QString unique; |
415 | 415 | ||
416 | QDir dir( locateLocal("data", "kopiemail" ) ); | 416 | QDir dir( locateLocal("data", "kopiemail" ) ); |
417 | 417 | ||
418 | QStringList imap = dir.entryList( "smtp-*" ); | 418 | QStringList imap = dir.entryList( "smtp-*" ); |
419 | do { | 419 | do { |
420 | unique.setNum( num++ ); | 420 | unique.setNum( num++ ); |
421 | } while ( imap.contains( "smtp-" + unique ) > 0 ); | 421 | } while ( imap.contains( "smtp-" + unique ) > 0 ); |
422 | 422 | ||
423 | return unique; | 423 | return unique; |
424 | } | 424 | } |
425 | 425 | ||
426 | void SMTPaccount::read() | 426 | void SMTPaccount::read() |
427 | { | 427 | { |
428 | KConfig *conf = new KConfig( getFileName() ); | 428 | KConfig *conf = new KConfig( getFileName() ); |
429 | conf->setGroup( "SMTP Account" ); | 429 | conf->setGroup( "SMTP Account" ); |
430 | accountName = conf->readEntry( "Account" ); | 430 | accountName = conf->readEntry( "Account" ); |
431 | server = conf->readEntry( "Server" ); | 431 | server = conf->readEntry( "Server" ); |
432 | port = conf->readEntry( "Port" ); | 432 | port = conf->readEntry( "Port" ); |
433 | ssl = conf->readBoolEntry( "SSL" ); | 433 | ssl = conf->readBoolEntry( "SSL" ); |
434 | connectionType = conf->readNumEntry( "ConnectionType" ); | 434 | connectionType = conf->readNumEntry( "ConnectionType" ); |
435 | login = conf->readBoolEntry( "Login" ); | 435 | login = conf->readBoolEntry( "Login" ); |
436 | user = conf->readEntry( "User" ); | 436 | user = conf->readEntry( "User" ); |
437 | signature = conf->readEntry( "SigFile" ); | 437 | signature = conf->readEntry( "SigFile" ); |
438 | setPasswordList( conf->readListEntry( "FolderHistory")); | 438 | setPasswordList( conf->readListEntry( "FolderHistory")); |
439 | delete conf; | 439 | delete conf; |
440 | } | 440 | } |
441 | 441 | ||
442 | void SMTPaccount::save() | 442 | void SMTPaccount::save() |
443 | { | 443 | { |
444 | Settings::checkDirectory(); | 444 | Settings::checkDirectory(); |
445 | 445 | ||
446 | KConfig *conf = new KConfig( getFileName() ); | 446 | KConfig *conf = new KConfig( getFileName() ); |
447 | conf->setGroup( "SMTP Account" ); | 447 | conf->setGroup( "SMTP Account" ); |
448 | conf->writeEntry( "Account", accountName ); | 448 | conf->writeEntry( "Account", accountName ); |
449 | conf->writeEntry( "Server", server ); | 449 | conf->writeEntry( "Server", server ); |
450 | conf->writeEntry( "Port", port ); | 450 | conf->writeEntry( "Port", port ); |
451 | conf->writeEntry( "SSL", ssl ); | 451 | conf->writeEntry( "SSL", ssl ); |
452 | conf->writeEntry( "ConnectionType", connectionType ); | 452 | conf->writeEntry( "ConnectionType", connectionType ); |
453 | conf->writeEntry( "Login", login ); | 453 | conf->writeEntry( "Login", login ); |
454 | conf->writeEntry( "User", user ); | 454 | conf->writeEntry( "User", user ); |
455 | conf->writeEntry( "SigFile", signature ); | 455 | conf->writeEntry( "SigFile", signature ); |
456 | //conf->writeEntryCrypt( "Password", password ); | 456 | //conf->writeEntryCrypt( "Password", password ); |
457 | conf->writeEntry( "FolderHistory",getPasswordList() ); | 457 | conf->writeEntry( "FolderHistory",getPasswordList() ); |
458 | conf->sync(); | 458 | conf->sync(); |
459 | delete conf; | 459 | delete conf; |
460 | } | 460 | } |
461 | 461 | ||
462 | 462 | ||
463 | QString SMTPaccount::getFileName() | 463 | QString SMTPaccount::getFileName() |
464 | { | 464 | { |
465 | return locateLocal("data", "kopiemail" ) +"/smtp-" + file; | 465 | return locateLocal("data", "kopiemail" ) +"/smtp-" + file; |
466 | } | 466 | } |
467 | 467 | ||
468 | NNTPaccount::NNTPaccount() | 468 | NNTPaccount::NNTPaccount() |
469 | : Account() | 469 | : Account() |
470 | { | 470 | { |
471 | file = NNTPaccount::getUniqueFileName(); | 471 | file = NNTPaccount::getUniqueFileName(); |
472 | accountName = "New NNTP Account"; | 472 | accountName = "New NNTP Account"; |
473 | ssl = false; | 473 | ssl = false; |
474 | login = false; | 474 | login = false; |
475 | type = MAILLIB::A_NNTP; | 475 | type = MAILLIB::A_NNTP; |
476 | port = NNTP_PORT; | 476 | port = NNTP_PORT; |
477 | } | 477 | } |
478 | 478 | ||
479 | NNTPaccount::NNTPaccount( QString filename ) | 479 | NNTPaccount::NNTPaccount( QString filename ) |
480 | : Account() | 480 | : Account() |
481 | { | 481 | { |
482 | file = filename; | 482 | file = filename; |
483 | accountName = "New NNTP Account"; | 483 | accountName = "New NNTP Account"; |
484 | ssl = false; | 484 | ssl = false; |
485 | login = false; | 485 | login = false; |
486 | type = MAILLIB::A_NNTP; | 486 | type = MAILLIB::A_NNTP; |
487 | port = NNTP_PORT; | 487 | port = NNTP_PORT; |
488 | } | 488 | } |
489 | 489 | ||
490 | QString NNTPaccount::getUniqueFileName() | 490 | QString NNTPaccount::getUniqueFileName() |
491 | { | 491 | { |
492 | int num = 0; | 492 | int num = 0; |
493 | QString unique; | 493 | QString unique; |
494 | 494 | ||
495 | QDir dir( locateLocal("data", "kopiemail" ) ); | 495 | QDir dir( locateLocal("data", "kopiemail" ) ); |
496 | 496 | ||
497 | QStringList imap = dir.entryList( "nntp-*" ); | 497 | QStringList imap = dir.entryList( "nntp-*" ); |
498 | do { | 498 | do { |
499 | unique.setNum( num++ ); | 499 | unique.setNum( num++ ); |
500 | } while ( imap.contains( "nntp-" + unique ) > 0 ); | 500 | } while ( imap.contains( "nntp-" + unique ) > 0 ); |
501 | 501 | ||
502 | return unique; | 502 | return unique; |