author | harlekin <harlekin> | 2004-01-04 02:35:03 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-01-04 02:35:03 (UTC) |
commit | d93529cebc9ea9ab4adf674e93e204f5a53d8906 (patch) (unidiff) | |
tree | 727ebb146a3518a2303d515c8e3e5e093397b9dc /noncore/net/mail/libmailwrapper/settings.cpp | |
parent | 55df8c221c43d81f6132d033553a173276954f7c (diff) | |
download | opie-d93529cebc9ea9ab4adf674e93e204f5a53d8906.zip opie-d93529cebc9ea9ab4adf674e93e204f5a53d8906.tar.gz opie-d93529cebc9ea9ab4adf674e93e204f5a53d8906.tar.bz2 |
adapt build system to lib etc and get it build
Diffstat (limited to 'noncore/net/mail/libmailwrapper/settings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 17aa1b0..c5187f5 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -1,55 +1,65 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | 5 | ||
6 | #include "settings.h" | 6 | #include "settings.h" |
7 | #include "defines.h" | 7 | //#include "defines.h" |
8 | |||
9 | #define IMAP_PORT "143" | ||
10 | #define IMAP_SSL_PORT "993" | ||
11 | #define SMTP_PORT "25" | ||
12 | #define SMTP_SSL_PORT "465" | ||
13 | #define POP3_PORT "110" | ||
14 | #define POP3_SSL_PORT "995" | ||
15 | #define NNTP_PORT "119" | ||
16 | #define NNTP_SSL_PORT "563" | ||
17 | |||
8 | 18 | ||
9 | Settings::Settings() | 19 | Settings::Settings() |
10 | : QObject() | 20 | : QObject() |
11 | { | 21 | { |
12 | updateAccounts(); | 22 | updateAccounts(); |
13 | } | 23 | } |
14 | 24 | ||
15 | void Settings::checkDirectory() | 25 | void Settings::checkDirectory() |
16 | { | 26 | { |
17 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
18 | system( "mkdir -p $HOME/Applications/opiemail" ); | 28 | system( "mkdir -p $HOME/Applications/opiemail" ); |
19 | qDebug( "$HOME/Applications/opiemail created" ); | 29 | qDebug( "$HOME/Applications/opiemail created" ); |
20 | } | 30 | } |
21 | } | 31 | } |
22 | 32 | ||
23 | QList<Account> Settings::getAccounts() | 33 | QList<Account> Settings::getAccounts() |
24 | { | 34 | { |
25 | return accounts; | 35 | return accounts; |
26 | } | 36 | } |
27 | 37 | ||
28 | void Settings::addAccount( Account *account ) | 38 | void Settings::addAccount( Account *account ) |
29 | { | 39 | { |
30 | accounts.append( account ); | 40 | accounts.append( account ); |
31 | } | 41 | } |
32 | 42 | ||
33 | void Settings::delAccount( Account *account ) | 43 | void Settings::delAccount( Account *account ) |
34 | { | 44 | { |
35 | accounts.remove( account ); | 45 | accounts.remove( account ); |
36 | account->remove(); | 46 | account->remove(); |
37 | } | 47 | } |
38 | 48 | ||
39 | void Settings::updateAccounts() | 49 | void Settings::updateAccounts() |
40 | { | 50 | { |
41 | accounts.clear(); | 51 | accounts.clear(); |
42 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); | 52 | QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); |
43 | QStringList::Iterator it; | 53 | QStringList::Iterator it; |
44 | 54 | ||
45 | QStringList imap = dir.entryList( "imap-*" ); | 55 | QStringList imap = dir.entryList( "imap-*" ); |
46 | for ( it = imap.begin(); it != imap.end(); it++ ) { | 56 | for ( it = imap.begin(); it != imap.end(); it++ ) { |
47 | qDebug( "Added IMAP account" ); | 57 | qDebug( "Added IMAP account" ); |
48 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); | 58 | IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); |
49 | accounts.append( account ); | 59 | accounts.append( account ); |
50 | } | 60 | } |
51 | 61 | ||
52 | QStringList pop3 = dir.entryList( "pop3-*" ); | 62 | QStringList pop3 = dir.entryList( "pop3-*" ); |
53 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { | 63 | for ( it = pop3.begin(); it != pop3.end(); it++ ) { |
54 | qDebug( "Added POP account" ); | 64 | qDebug( "Added POP account" ); |
55 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); | 65 | POP3account *account = new POP3account( (*it).replace(0, 5, "") ); |