author | zautrix <zautrix> | 2004-12-13 12:35:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-13 12:35:00 (UTC) |
commit | 7ac6c21e832b7d16bd0888d0b66252b6e152005a (patch) (unidiff) | |
tree | c7610e0e25020f19af82ac6257c2debab2638316 /kmicromail/libmailwrapper | |
parent | 17b25691f0332e648dd1d800e89ccf4e1da8955d (diff) | |
download | kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.zip kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.gz kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.bz2 |
many bugfixes
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 04afe7c..19093b1 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -5,98 +5,98 @@ | |||
5 | #include <kconfig.h> | 5 | #include <kconfig.h> |
6 | 6 | ||
7 | #include <kstandarddirs.h> | 7 | #include <kstandarddirs.h> |
8 | #include "settings.h" | 8 | #include "settings.h" |
9 | //#include "defines.h" | 9 | //#include "defines.h" |
10 | 10 | ||
11 | #define IMAP_PORT "143" | 11 | #define IMAP_PORT "143" |
12 | #define IMAP_SSL_PORT "993" | 12 | #define IMAP_SSL_PORT "993" |
13 | #define SMTP_PORT "25" | 13 | #define SMTP_PORT "25" |
14 | #define SMTP_SSL_PORT "465" | 14 | #define SMTP_SSL_PORT "465" |
15 | #define POP3_PORT "110" | 15 | #define POP3_PORT "110" |
16 | #define POP3_SSL_PORT "995" | 16 | #define POP3_SSL_PORT "995" |
17 | #define NNTP_PORT "119" | 17 | #define NNTP_PORT "119" |
18 | #define NNTP_SSL_PORT "563" | 18 | #define NNTP_SSL_PORT "563" |
19 | 19 | ||
20 | 20 | ||
21 | Settings::Settings() | 21 | Settings::Settings() |
22 | : QObject() | 22 | : QObject() |
23 | { | 23 | { |
24 | accounts.setAutoDelete( true ); ; | 24 | accounts.setAutoDelete( true ); ; |
25 | updateAccounts(); | 25 | updateAccounts(); |
26 | //qDebug("++++++++++++++++++new settings "); | 26 | //qDebug("++++++++++++++++++new settings "); |
27 | } | 27 | } |
28 | 28 | ||
29 | void Settings::checkDirectory() | 29 | void Settings::checkDirectory() |
30 | { | 30 | { |
31 | return; | 31 | return; |
32 | locateLocal("data", "kopiemail" ); | 32 | locateLocal("data", "kopiemail" ); |
33 | /* | 33 | /* |
34 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 34 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
35 | system( "mkdir -p $HOME/Applications/opiemail" ); | 35 | system( "mkdir -p $HOME/Applications/opiemail" ); |
36 | qDebug("$HOME/Applications/opiemail created "); | 36 | qDebug("$HOME/Applications/opiemail created "); |
37 | } | 37 | } |
38 | */ | 38 | */ |
39 | } | 39 | } |
40 | 40 | ||
41 | QList<Account> Settings::getAccounts() | 41 | QList<Account> Settings::getAccounts() |
42 | { | 42 | { |
43 | return accounts; | 43 | return accounts; |
44 | } | 44 | } |
45 | 45 | ||
46 | void Settings::addAccount( Account *account ) | 46 | void Settings::addAccount( Account *account ) |
47 | { | 47 | { |
48 | accounts.append( account ); | 48 | accounts.append( account ); |
49 | } | 49 | } |
50 | 50 | ||
51 | void Settings::delAccount( Account *account ) | 51 | void Settings::delAccount( Account *account ) |
52 | { | 52 | { |
53 | accounts.remove( account ); | ||
54 | account->remove(); | 53 | account->remove(); |
54 | accounts.remove( account ); | ||
55 | } | 55 | } |
56 | 56 | ||
57 | void Settings::updateAccounts() | 57 | void Settings::updateAccounts() |
58 | { | 58 | { |
59 | accounts.clear(); | 59 | accounts.clear(); |
60 | QDir dir( locateLocal("data", "kopiemail" ) ); | 60 | QDir dir( locateLocal("data", "kopiemail" ) ); |
61 | QStringList::Iterator it; | 61 | QStringList::Iterator it; |
62 | 62 | ||
63 | QStringList imap = dir.entryList( "imap-*" ); | 63 | QStringList imap = dir.entryList( "imap-*" ); |
64 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 64 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
65 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 65 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
66 | accounts.append( account ); | 66 | accounts.append( account ); |
67 | } | 67 | } |
68 | 68 | ||
69 | QStringList pop3 = dir.entryList( "pop3-*" ); | 69 | QStringList pop3 = dir.entryList( "pop3-*" ); |
70 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 70 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
71 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 71 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |
72 | accounts.append( account ); | 72 | accounts.append( account ); |
73 | } | 73 | } |
74 | 74 | ||
75 | QStringList smtp = dir.entryList( "smtp-*" ); | 75 | QStringList smtp = dir.entryList( "smtp-*" ); |
76 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { | 76 | for ( it = smtp.begin(); it != smtp.end(); it++ ) { |
77 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); | 77 | SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); |
78 | accounts.append( account ); | 78 | accounts.append( account ); |
79 | } | 79 | } |
80 | 80 | ||
81 | QStringList nntp = dir.entryList( "nntp-*" ); | 81 | QStringList nntp = dir.entryList( "nntp-*" ); |
82 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { | 82 | for ( it = nntp.begin(); it != nntp.end(); it++ ) { |
83 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); | 83 | NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); |
84 | accounts.append( account ); | 84 | accounts.append( account ); |
85 | } | 85 | } |
86 | 86 | ||
87 | readAccounts(); | 87 | readAccounts(); |
88 | } | 88 | } |
89 | 89 | ||
90 | void Settings::saveAccounts() | 90 | void Settings::saveAccounts() |
91 | { | 91 | { |
92 | checkDirectory(); | 92 | checkDirectory(); |
93 | Account *it; | 93 | Account *it; |
94 | 94 | ||
95 | for ( it = accounts.first(); it; it = accounts.next() ) { | 95 | for ( it = accounts.first(); it; it = accounts.next() ) { |
96 | it->save(); | 96 | it->save(); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | void Settings::readAccounts() | 100 | void Settings::readAccounts() |
101 | { | 101 | { |
102 | checkDirectory(); | 102 | checkDirectory(); |