author | alwin <alwin> | 2004-03-08 01:00:18 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-08 01:00:18 (UTC) |
commit | eddc5184f5be6a067b077d18e240a1fe982bbcf4 (patch) (unidiff) | |
tree | 0d9458a10520ca23e1d5d041d9d2ca4150bd8f1c | |
parent | eedafdf1a1d973c083cb108a913005d14a78a9ae (diff) | |
download | opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.zip opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.tar.gz opie-eddc5184f5be6a067b077d18e240a1fe982bbcf4.tar.bz2 |
type of mail account will be defined by a enum not with string - comparing
strings all the time makes no sense.
21 files changed, 93 insertions, 48 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 64557ee..4375044 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -59,26 +59,26 @@ void AccountView::populate( QList<Account> list ) | |||
59 | 59 | ||
60 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); | 60 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); |
61 | 61 | ||
62 | Account *it; | 62 | Account *it; |
63 | for ( it = list.first(); it; it = list.next() ) | 63 | for ( it = list.first(); it; it = list.next() ) |
64 | { | 64 | { |
65 | if ( it->getType().compare( "IMAP" ) == 0 ) | 65 | if ( it->getType() == MAILLIB::A_IMAP ) |
66 | { | 66 | { |
67 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 67 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
68 | qDebug( "added IMAP " + imap->getAccountName() ); | 68 | qDebug( "added IMAP " + imap->getAccountName() ); |
69 | imapAccounts.append(new IMAPviewItem( imap, this )); | 69 | imapAccounts.append(new IMAPviewItem( imap, this )); |
70 | } | 70 | } |
71 | else if ( it->getType().compare( "POP3" ) == 0 ) | 71 | else if ( it->getType() == MAILLIB::A_POP3 ) |
72 | { | 72 | { |
73 | POP3account *pop3 = static_cast<POP3account *>(it); | 73 | POP3account *pop3 = static_cast<POP3account *>(it); |
74 | qDebug( "added POP3 " + pop3->getAccountName() ); | 74 | qDebug( "added POP3 " + pop3->getAccountName() ); |
75 | /* must not be hold 'cause it isn't required */ | 75 | /* must not be hold 'cause it isn't required */ |
76 | (void) new POP3viewItem( pop3, this ); | 76 | (void) new POP3viewItem( pop3, this ); |
77 | } | 77 | } |
78 | else if ( it->getType().compare( "NNTP" ) == 0 ) | 78 | else if ( it->getType() == MAILLIB::A_NNTP ) |
79 | { | 79 | { |
80 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 80 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
81 | qDebug( "added NNTP " + nntp->getAccountName() ); | 81 | qDebug( "added NNTP " + nntp->getAccountName() ); |
82 | /* must not be hold 'cause it isn't required */ | 82 | /* must not be hold 'cause it isn't required */ |
83 | (void) new NNTPviewItem( nntp, this ); | 83 | (void) new NNTPviewItem( nntp, this ); |
84 | } | 84 | } |
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index f51a8fe..f8ac76f 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -43,13 +43,13 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
43 | attList->addColumn( tr( "Size" ) ); | 43 | attList->addColumn( tr( "Size" ) ); |
44 | 44 | ||
45 | QList<Account> accounts = settings->getAccounts(); | 45 | QList<Account> accounts = settings->getAccounts(); |
46 | 46 | ||
47 | Account *it; | 47 | Account *it; |
48 | for ( it = accounts.first(); it; it = accounts.next() ) { | 48 | for ( it = accounts.first(); it; it = accounts.next() ) { |
49 | if ( it->getType().compare( "SMTP" ) == 0 ) { | 49 | if ( it->getType()==MAILLIB::A_SMTP ) { |
50 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 50 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
51 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 51 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
52 | smtpAccounts.append( smtp ); | 52 | smtpAccounts.append( smtp ); |
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 28d531b..5c4bdf7 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -13,13 +13,31 @@ | |||
13 | 13 | ||
14 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 14 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
15 | : QListViewItem( parent ) | 15 | : QListViewItem( parent ) |
16 | { | 16 | { |
17 | account = a; | 17 | account = a; |
18 | setText( 0, account->getAccountName() ); | 18 | setText( 0, account->getAccountName() ); |
19 | setText( 1, account->getType() ); | 19 | QString ttext = ""; |
20 | switch (account->getType()) { | ||
21 | case MAILLIB::A_NNTP: | ||
22 | ttext="NNTP"; | ||
23 | break; | ||
24 | case MAILLIB::A_POP3: | ||
25 | ttext = "POP3"; | ||
26 | break; | ||
27 | case MAILLIB::A_IMAP: | ||
28 | ttext = "IMAP"; | ||
29 | break; | ||
30 | case MAILLIB::A_SMTP: | ||
31 | ttext = "SMTP"; | ||
32 | break; | ||
33 | default: | ||
34 | ttext = "UNKNOWN"; | ||
35 | break; | ||
36 | } | ||
37 | setText( 1, ttext); | ||
20 | } | 38 | } |
21 | 39 | ||
22 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 40 | EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
23 | : EditAccountsUI( parent, name, modal, flags ) | 41 | : EditAccountsUI( parent, name, modal, flags ) |
24 | { | 42 | { |
25 | qDebug( "New Account Configuration Widget" ); | 43 | qDebug( "New Account Configuration Widget" ); |
@@ -46,13 +64,13 @@ void EditAccounts::slotFillLists() | |||
46 | newsList->clear(); | 64 | newsList->clear(); |
47 | 65 | ||
48 | QList<Account> accounts = settings->getAccounts(); | 66 | QList<Account> accounts = settings->getAccounts(); |
49 | Account *it; | 67 | Account *it; |
50 | for ( it = accounts.first(); it; it = accounts.next() ) | 68 | for ( it = accounts.first(); it; it = accounts.next() ) |
51 | { | 69 | { |
52 | if ( it->getType().compare( "NNTP" ) == 0 ) | 70 | if ( it->getType()==MAILLIB::A_NNTP ) |
53 | { | 71 | { |
54 | (void) new AccountListItem( newsList, it ); | 72 | (void) new AccountListItem( newsList, it ); |
55 | } | 73 | } |
56 | else | 74 | else |
57 | { | 75 | { |
58 | (void) new AccountListItem( mailList, it ); | 76 | (void) new AccountListItem( mailList, it ); |
@@ -140,40 +158,40 @@ void EditAccounts::slotNewAccount( const QString &type ) | |||
140 | } | 158 | } |
141 | } | 159 | } |
142 | } | 160 | } |
143 | 161 | ||
144 | void EditAccounts::slotEditAccount( Account *account ) | 162 | void EditAccounts::slotEditAccount( Account *account ) |
145 | { | 163 | { |
146 | if ( account->getType().compare( "IMAP" ) == 0 ) | 164 | if ( account->getType() == MAILLIB::A_IMAP ) |
147 | { | 165 | { |
148 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); | 166 | IMAPaccount *imapAcc = static_cast<IMAPaccount *>(account); |
149 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); | 167 | IMAPconfig imap( imapAcc, this, 0, true, WStyle_ContextHelp ); |
150 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) | 168 | if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) |
151 | { | 169 | { |
152 | slotFillLists(); | 170 | slotFillLists(); |
153 | } | 171 | } |
154 | } | 172 | } |
155 | else if ( account->getType().compare( "POP3" ) == 0 ) | 173 | else if ( account->getType()==MAILLIB::A_POP3 ) |
156 | { | 174 | { |
157 | POP3account *pop3Acc = static_cast<POP3account *>(account); | 175 | POP3account *pop3Acc = static_cast<POP3account *>(account); |
158 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); | 176 | POP3config pop3( pop3Acc, this, 0, true, WStyle_ContextHelp ); |
159 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) | 177 | if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) |
160 | { | 178 | { |
161 | slotFillLists(); | 179 | slotFillLists(); |
162 | } | 180 | } |
163 | } | 181 | } |
164 | else if ( account->getType().compare( "SMTP" ) == 0 ) | 182 | else if ( account->getType()==MAILLIB::A_SMTP ) |
165 | { | 183 | { |
166 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); | 184 | SMTPaccount *smtpAcc = static_cast<SMTPaccount *>(account); |
167 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); | 185 | SMTPconfig smtp( smtpAcc, this, 0, true, WStyle_ContextHelp ); |
168 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) | 186 | if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) |
169 | { | 187 | { |
170 | slotFillLists(); | 188 | slotFillLists(); |
171 | } | 189 | } |
172 | } | 190 | } |
173 | else if ( account->getType().compare( "NNTP" ) == 0 ) | 191 | else if ( account->getType()==MAILLIB::A_NNTP) |
174 | { | 192 | { |
175 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); | 193 | NNTPaccount *nntpAcc = static_cast<NNTPaccount *>(account); |
176 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); | 194 | NNTPconfig nntp( nntpAcc, this, 0, true, WStyle_ContextHelp ); |
177 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) | 195 | if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) |
178 | { | 196 | { |
179 | slotFillLists(); | 197 | slotFillLists(); |
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index b6e1538..442ebfe 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -1,9 +1,11 @@ | |||
1 | #ifndef __abstract_mail_ | 1 | #ifndef __abstract_mail_ |
2 | #define __abstract_mail_ | 2 | #define __abstract_mail_ |
3 | 3 | ||
4 | #include "maildefines.h" | ||
5 | |||
4 | #include <qobject.h> | 6 | #include <qobject.h> |
5 | #include "settings.h" | 7 | #include "settings.h" |
6 | 8 | ||
7 | class RecMail; | 9 | class RecMail; |
8 | class RecBody; | 10 | class RecBody; |
9 | class RecPart; | 11 | class RecPart; |
@@ -52,13 +54,13 @@ public: | |||
52 | static AbstractMail* getWrapper(NNTPaccount *a); | 54 | static AbstractMail* getWrapper(NNTPaccount *a); |
53 | /* mbox only! */ | 55 | /* mbox only! */ |
54 | static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); | 56 | static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); |
55 | 57 | ||
56 | static QString defaultLocalfolder(); | 58 | static QString defaultLocalfolder(); |
57 | 59 | ||
58 | virtual const QString&getType()const=0; | 60 | virtual MAILLIB::ATYPE getType()const=0; |
59 | virtual const QString&getName()const=0; | 61 | virtual const QString&getName()const=0; |
60 | 62 | ||
61 | protected: | 63 | protected: |
62 | static encodedString*decode_String(const encodedString*text,const QString&enc); | 64 | static encodedString*decode_String(const encodedString*text,const QString&enc); |
63 | static QString convert_String(const char*text); | 65 | static QString convert_String(const char*text); |
64 | static QString gen_attachment_id(); | 66 | static QString gen_attachment_id(); |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 350808a..3fe319b 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -441,13 +441,13 @@ void Genericwrapper::cleanMimeCache() | |||
441 | if (t) delete t; | 441 | if (t) delete t; |
442 | } | 442 | } |
443 | bodyCache.clear(); | 443 | bodyCache.clear(); |
444 | qDebug("Genericwrapper: cache cleaned"); | 444 | qDebug("Genericwrapper: cache cleaned"); |
445 | } | 445 | } |
446 | 446 | ||
447 | void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox) | 447 | void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to) |
448 | { | 448 | { |
449 | int r; | 449 | int r; |
450 | mailmessage_list * env_list = 0; | 450 | mailmessage_list * env_list = 0; |
451 | r = mailsession_get_messages_list(session,&env_list); | 451 | r = mailsession_get_messages_list(session,&env_list); |
452 | if (r != MAIL_NO_ERROR) { | 452 | if (r != MAIL_NO_ERROR) { |
453 | qDebug("Error message list"); | 453 | qDebug("Error message list"); |
@@ -485,14 +485,18 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const | |||
485 | mail->setMbox(mailbox); | 485 | mail->setMbox(mailbox); |
486 | mail->setNumber(msg->msg_index); | 486 | mail->setNumber(msg->msg_index); |
487 | if (single_fields.fld_subject) | 487 | if (single_fields.fld_subject) |
488 | mail->setSubject( convert_String(single_fields.fld_subject->sbj_value)); | 488 | mail->setSubject( convert_String(single_fields.fld_subject->sbj_value)); |
489 | if (single_fields.fld_from) | 489 | if (single_fields.fld_from) |
490 | mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list)); | 490 | mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list)); |
491 | if (single_fields.fld_to) | 491 | if (!mbox_as_to) { |
492 | mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) ); | 492 | if (single_fields.fld_to) |
493 | mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) ); | ||
494 | } else { | ||
495 | mail->setTo(mailbox); | ||
496 | } | ||
493 | if (single_fields.fld_cc) | 497 | if (single_fields.fld_cc) |
494 | mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) ); | 498 | mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) ); |
495 | if (single_fields.fld_bcc) | 499 | if (single_fields.fld_bcc) |
496 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); | 500 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); |
497 | if (single_fields.fld_orig_date) | 501 | if (single_fields.fld_orig_date) |
498 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); | 502 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); |
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index e471dc8..b451416 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h | |||
@@ -51,13 +51,13 @@ protected: | |||
51 | QString parseDateTime( mailimf_date_time *date ); | 51 | QString parseDateTime( mailimf_date_time *date ); |
52 | 52 | ||
53 | void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); | 53 | void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); |
54 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); | 54 | static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); |
55 | static void fillParameters(RecPart&target,clist*parameters); | 55 | static void fillParameters(RecPart&target,clist*parameters); |
56 | static QString getencoding(mailmime_mechanism*aEnc); | 56 | static QString getencoding(mailmime_mechanism*aEnc); |
57 | virtual void parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox); | 57 | virtual void parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); |
58 | 58 | ||
59 | QString msgTempName; | 59 | QString msgTempName; |
60 | unsigned int last_msg_id; | 60 | unsigned int last_msg_id; |
61 | QMap<QString,encodedString*> bodyCache; | 61 | QMap<QString,encodedString*> bodyCache; |
62 | mailstorage * m_storage; | 62 | mailstorage * m_storage; |
63 | mailfolder*m_folder; | 63 | mailfolder*m_folder; |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 1dfcc4c..3375e69 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -1087,13 +1087,13 @@ void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folde | |||
1087 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); | 1087 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); |
1088 | if (r != MAILIMAP_NO_ERROR) { | 1088 | if (r != MAILIMAP_NO_ERROR) { |
1089 | Global::statusMessage("Error storing mail!"); | 1089 | Global::statusMessage("Error storing mail!"); |
1090 | } | 1090 | } |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | const QString&IMAPwrapper::getType()const | 1093 | MAILLIB::ATYPE IMAPwrapper::getType()const |
1094 | { | 1094 | { |
1095 | return account->getType(); | 1095 | return account->getType(); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | const QString&IMAPwrapper::getName()const | 1098 | const QString&IMAPwrapper::getName()const |
1099 | { | 1099 | { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index 0a1fe2c..2623725 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -43,13 +43,13 @@ public: | |||
43 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 43 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
44 | virtual int deleteMbox(const Folder*folder); | 44 | virtual int deleteMbox(const Folder*folder); |
45 | 45 | ||
46 | static void imap_progress( size_t current, size_t maximum ); | 46 | static void imap_progress( size_t current, size_t maximum ); |
47 | 47 | ||
48 | virtual void logout(); | 48 | virtual void logout(); |
49 | virtual const QString&getType()const; | 49 | virtual MAILLIB::ATYPE getType()const; |
50 | virtual const QString&getName()const; | 50 | virtual const QString&getName()const; |
51 | 51 | ||
52 | protected: | 52 | protected: |
53 | RecMail*parse_list_result(mailimap_msg_att*); | 53 | RecMail*parse_list_result(mailimap_msg_att*); |
54 | void login(); | 54 | void login(); |
55 | bool start_tls(bool force=true); | 55 | bool start_tls(bool force=true); |
diff --git a/noncore/net/mail/libmailwrapper/maildefines.h b/noncore/net/mail/libmailwrapper/maildefines.h new file mode 100644 index 0000000..431f9ea --- a/dev/null +++ b/noncore/net/mail/libmailwrapper/maildefines.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __MAILDEFINES_H | ||
2 | #define __MAILDEFINES_H | ||
3 | |||
4 | namespace MAILLIB { | ||
5 | enum ATYPE { | ||
6 | A_UNDEFINED, | ||
7 | A_IMAP, | ||
8 | A_POP3, | ||
9 | A_SMTP, | ||
10 | A_MH, | ||
11 | A_MBOX, | ||
12 | A_NNTP, | ||
13 | }; | ||
14 | } | ||
15 | |||
16 | #endif | ||
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 97f301e..11ffd92 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -3,13 +3,13 @@ | |||
3 | #include "mailwrapper.h" | 3 | #include "mailwrapper.h" |
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | #include <qdir.h> | 5 | #include <qdir.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
8 | 8 | ||
9 | const QString MBOXwrapper::wrapperType="MBOX"; | 9 | const MAILLIB::ATYPE MBOXwrapper::wrapperType=MAILLIB::MBOX; |
10 | 10 | ||
11 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) | 11 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) |
12 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) | 12 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) |
13 | { | 13 | { |
14 | QDir dir(MBOXPath); | 14 | QDir dir(MBOXPath); |
15 | if (!dir.exists()) { | 15 | if (!dir.exists()) { |
@@ -323,13 +323,13 @@ void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
323 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | 323 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, |
324 | &target_stat.message_recent,&target_stat.message_unseen); | 324 | &target_stat.message_recent,&target_stat.message_unseen); |
325 | if (folder) mailfolder_free(folder); | 325 | if (folder) mailfolder_free(folder); |
326 | if (storage) mailstorage_free(storage); | 326 | if (storage) mailstorage_free(storage); |
327 | } | 327 | } |
328 | 328 | ||
329 | const QString&MBOXwrapper::getType()const | 329 | MAILLIB::ATYPE MBOXwrapper::getType()const |
330 | { | 330 | { |
331 | return wrapperType; | 331 | return wrapperType; |
332 | } | 332 | } |
333 | 333 | ||
334 | const QString&MBOXwrapper::getName()const | 334 | const QString&MBOXwrapper::getName()const |
335 | { | 335 | { |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index a579a3d..a12a1dd 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h | |||
@@ -32,17 +32,17 @@ public: | |||
32 | virtual RecBody fetchBody( const RecMail &mail ); | 32 | virtual RecBody fetchBody( const RecMail &mail ); |
33 | static void mbox_progress( size_t current, size_t maximum ); | 33 | static void mbox_progress( size_t current, size_t maximum ); |
34 | 34 | ||
35 | virtual encodedString* fetchRawBody(const RecMail&mail); | 35 | virtual encodedString* fetchRawBody(const RecMail&mail); |
36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 36 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
37 | virtual int deleteAllMail(const Folder*); | 37 | virtual int deleteAllMail(const Folder*); |
38 | virtual const QString&getType()const; | 38 | virtual MAILLIB::ATYPE getType()const; |
39 | virtual const QString&getName()const; | 39 | virtual const QString&getName()const; |
40 | 40 | ||
41 | protected: | 41 | protected: |
42 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); | 42 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); |
43 | QString MBOXPath; | 43 | QString MBOXPath; |
44 | QString MBOXName; | 44 | QString MBOXName; |
45 | static const QString wrapperType; | 45 | static const MAILLIB::ATYPE wrapperType; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | #endif | 48 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index df7f773..179bd34 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp | |||
@@ -5,13 +5,13 @@ | |||
5 | #include <qdir.h> | 5 | #include <qdir.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <qpe/global.h> | 8 | #include <qpe/global.h> |
9 | #include <opie2/oprocess.h> | 9 | #include <opie2/oprocess.h> |
10 | 10 | ||
11 | const QString MHwrapper::wrapperType="MH"; | 11 | const MAILLIB::ATYPE MHwrapper::wrapperType=MAILLIB::A_MH; |
12 | 12 | ||
13 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) | 13 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) |
14 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) | 14 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) |
15 | { | 15 | { |
16 | if (MHPath.length()>0) { | 16 | if (MHPath.length()>0) { |
17 | if (MHPath[MHPath.length()-1]=='/') { | 17 | if (MHPath[MHPath.length()-1]=='/') { |
@@ -363,13 +363,13 @@ void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
363 | &target_stat.message_recent,&target_stat.message_unseen); | 363 | &target_stat.message_recent,&target_stat.message_unseen); |
364 | if (r != MAIL_NO_ERROR) { | 364 | if (r != MAIL_NO_ERROR) { |
365 | Global::statusMessage(tr("Error retrieving status")); | 365 | Global::statusMessage(tr("Error retrieving status")); |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | const QString&MHwrapper::getType()const | 369 | MAILLIB::ATYPE MHwrapper::getType()const |
370 | { | 370 | { |
371 | return wrapperType; | 371 | return wrapperType; |
372 | } | 372 | } |
373 | 373 | ||
374 | const QString&MHwrapper::getName()const | 374 | const QString&MHwrapper::getName()const |
375 | { | 375 | { |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h index b8e380c..c1ba78d 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.h +++ b/noncore/net/mail/libmailwrapper/mhwrapper.h | |||
@@ -1,9 +1,11 @@ | |||
1 | #ifndef __MH_WRAPPER_H | 1 | #ifndef __MH_WRAPPER_H |
2 | #define __MH_WRAPPER_H | 2 | #define __MH_WRAPPER_H |
3 | 3 | ||
4 | #include "maildefines.h" | ||
5 | |||
4 | #include "genericwrapper.h" | 6 | #include "genericwrapper.h" |
5 | #include <qstring.h> | 7 | #include <qstring.h> |
6 | 8 | ||
7 | class RecMail; | 9 | class RecMail; |
8 | class RecBody; | 10 | class RecBody; |
9 | class encodedString; | 11 | class encodedString; |
@@ -34,24 +36,24 @@ public: | |||
34 | virtual RecBody fetchBody( const RecMail &mail ); | 36 | virtual RecBody fetchBody( const RecMail &mail ); |
35 | static void mbox_progress( size_t current, size_t maximum ); | 37 | static void mbox_progress( size_t current, size_t maximum ); |
36 | 38 | ||
37 | virtual encodedString* fetchRawBody(const RecMail&mail); | 39 | virtual encodedString* fetchRawBody(const RecMail&mail); |
38 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); | 40 | virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); |
39 | virtual int deleteAllMail(const Folder*); | 41 | virtual int deleteAllMail(const Folder*); |
40 | virtual const QString&getType()const; | 42 | virtual MAILLIB::ATYPE getType()const; |
41 | virtual const QString&getName()const; | 43 | virtual const QString&getName()const; |
42 | 44 | ||
43 | public slots: | 45 | public slots: |
44 | /* for deleting maildirs we are using a system call */ | 46 | /* for deleting maildirs we are using a system call */ |
45 | virtual void oprocessStderr(OProcess*, char *buffer, int ); | 47 | virtual void oprocessStderr(OProcess*, char *buffer, int ); |
46 | virtual void processEnded(OProcess *); | 48 | virtual void processEnded(OProcess *); |
47 | protected: | 49 | protected: |
48 | QString buildPath(const QString&p); | 50 | QString buildPath(const QString&p); |
49 | QString MHPath; | 51 | QString MHPath; |
50 | QString MHName; | 52 | QString MHName; |
51 | static const QString wrapperType; | 53 | static const MAILLIB::ATYPE wrapperType; |
52 | 54 | ||
53 | void init_storage(); | 55 | void init_storage(); |
54 | void clean_storage(); | 56 | void clean_storage(); |
55 | 57 | ||
56 | bool removeMboxfailed; | 58 | bool removeMboxfailed; |
57 | }; | 59 | }; |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 5a8c224..1956c61 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -100,13 +100,13 @@ void NNTPwrapper::listMessages(const QString & which, QList<RecMail> &target ) | |||
100 | { | 100 | { |
101 | login(); | 101 | login(); |
102 | if (!m_nntp) | 102 | if (!m_nntp) |
103 | return; | 103 | return; |
104 | uint32_t res_messages,res_recent,res_unseen; | 104 | uint32_t res_messages,res_recent,res_unseen; |
105 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); | 105 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); |
106 | parseList(target,m_nntp->sto_session,which); | 106 | parseList(target,m_nntp->sto_session,which,true); |
107 | } | 107 | } |
108 | 108 | ||
109 | void NNTPwrapper::login() | 109 | void NNTPwrapper::login() |
110 | { | 110 | { |
111 | if (account->getOffline()) | 111 | if (account->getOffline()) |
112 | return; | 112 | return; |
@@ -266,19 +266,19 @@ encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { | |||
266 | if (target) { | 266 | if (target) { |
267 | res = new encodedString(target,length); | 267 | res = new encodedString(target,length); |
268 | } | 268 | } |
269 | return res; | 269 | return res; |
270 | } | 270 | } |
271 | 271 | ||
272 | const QString&NNTPwrapper::getType()const { | 272 | MAILLIB::ATYPE NNTPwrapper::getType()const { |
273 | return account->getType(); | 273 | return account->getType(); |
274 | } | 274 | } |
275 | 275 | ||
276 | const QString&NNTPwrapper::getName()const{ | 276 | const QString&NNTPwrapper::getName()const{ |
277 | return account->getAccountName(); | 277 | return account->getAccountName(); |
278 | } | 278 | } |
279 | 279 | ||
280 | void NNTPwrapper::deleteMail(const RecMail&mail) { | 280 | void NNTPwrapper::deleteMail(const RecMail&) { |
281 | } | 281 | } |
282 | 282 | ||
283 | int NNTPwrapper::deleteAllMail(const Folder*) { | 283 | int NNTPwrapper::deleteAllMail(const Folder*) { |
284 | } | 284 | } |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h index d51c955..955b9f1 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.h +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h | |||
@@ -30,13 +30,13 @@ public: | |||
30 | virtual void answeredMail(const RecMail&mail); | 30 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*); | 31 | virtual int deleteAllMail(const Folder*); |
32 | 32 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 33 | virtual RecBody fetchBody( const RecMail &mail ); |
34 | virtual encodedString* fetchRawBody(const RecMail&mail); | 34 | virtual encodedString* fetchRawBody(const RecMail&mail); |
35 | virtual void logout(); | 35 | virtual void logout(); |
36 | virtual const QString&getType()const; | 36 | virtual MAILLIB::ATYPE getType()const; |
37 | virtual const QString&getName()const; | 37 | virtual const QString&getName()const; |
38 | static void nntp_progress( size_t current, size_t maximum ); | 38 | static void nntp_progress( size_t current, size_t maximum ); |
39 | 39 | ||
40 | protected: | 40 | protected: |
41 | void login(); | 41 | void login(); |
42 | NNTPaccount *account; | 42 | NNTPaccount *account; |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 6fab401..0939b22 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -243,13 +243,13 @@ encodedString* POP3wrapper::fetchRawBody(const RecMail&mail) { | |||
243 | if (target) { | 243 | if (target) { |
244 | res = new encodedString(target,length); | 244 | res = new encodedString(target,length); |
245 | } | 245 | } |
246 | return res; | 246 | return res; |
247 | } | 247 | } |
248 | 248 | ||
249 | const QString&POP3wrapper::getType()const { | 249 | MAILLIB::ATYPE POP3wrapper::getType()const { |
250 | return account->getType(); | 250 | return account->getType(); |
251 | } | 251 | } |
252 | 252 | ||
253 | const QString&POP3wrapper::getName()const{ | 253 | const QString&POP3wrapper::getName()const{ |
254 | return account->getAccountName(); | 254 | return account->getAccountName(); |
255 | } | 255 | } |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index a24b9cf..391c841 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -26,13 +26,13 @@ public: | |||
26 | virtual void answeredMail(const RecMail&mail); | 26 | virtual void answeredMail(const RecMail&mail); |
27 | virtual int deleteAllMail(const Folder*); | 27 | virtual int deleteAllMail(const Folder*); |
28 | 28 | ||
29 | virtual RecBody fetchBody( const RecMail &mail ); | 29 | virtual RecBody fetchBody( const RecMail &mail ); |
30 | virtual encodedString* fetchRawBody(const RecMail&mail); | 30 | virtual encodedString* fetchRawBody(const RecMail&mail); |
31 | virtual void logout(); | 31 | virtual void logout(); |
32 | virtual const QString&getType()const; | 32 | virtual MAILLIB::ATYPE getType()const; |
33 | virtual const QString&getName()const; | 33 | virtual const QString&getName()const; |
34 | static void pop3_progress( size_t current, size_t maximum ); | 34 | static void pop3_progress( size_t current, size_t maximum ); |
35 | 35 | ||
36 | protected: | 36 | protected: |
37 | void login(); | 37 | void login(); |
38 | POP3account *account; | 38 | POP3account *account; |
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index 0d34fd5..2c81963 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -103,13 +103,13 @@ void Settings::readAccounts() | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | Account::Account() | 106 | Account::Account() |
107 | { | 107 | { |
108 | accountName = "changeMe"; | 108 | accountName = "changeMe"; |
109 | type = "changeMe"; | 109 | type = MAILLIB::A_UNDEFINED; |
110 | ssl = false; | 110 | ssl = false; |
111 | connectionType = 1; | 111 | connectionType = 1; |
112 | offline = false; | 112 | offline = false; |
113 | } | 113 | } |
114 | 114 | ||
115 | void Account::remove() | 115 | void Account::remove() |
@@ -122,24 +122,24 @@ IMAPaccount::IMAPaccount() | |||
122 | : Account() | 122 | : Account() |
123 | { | 123 | { |
124 | file = IMAPaccount::getUniqueFileName(); | 124 | file = IMAPaccount::getUniqueFileName(); |
125 | accountName = "New IMAP Account"; | 125 | accountName = "New IMAP Account"; |
126 | ssl = false; | 126 | ssl = false; |
127 | connectionType = 1; | 127 | connectionType = 1; |
128 | type = "IMAP"; | 128 | type = MAILLIB::A_IMAP; |
129 | port = IMAP_PORT; | 129 | port = IMAP_PORT; |
130 | } | 130 | } |
131 | 131 | ||
132 | IMAPaccount::IMAPaccount( QString filename ) | 132 | IMAPaccount::IMAPaccount( QString filename ) |
133 | : Account() | 133 | : Account() |
134 | { | 134 | { |
135 | file = filename; | 135 | file = filename; |
136 | accountName = "New IMAP Account"; | 136 | accountName = "New IMAP Account"; |
137 | ssl = false; | 137 | ssl = false; |
138 | connectionType = 1; | 138 | connectionType = 1; |
139 | type = "IMAP"; | 139 | type = MAILLIB::A_IMAP; |
140 | port = IMAP_PORT; | 140 | port = IMAP_PORT; |
141 | } | 141 | } |
142 | 142 | ||
143 | QString IMAPaccount::getUniqueFileName() | 143 | QString IMAPaccount::getUniqueFileName() |
144 | { | 144 | { |
145 | int num = 0; | 145 | int num = 0; |
@@ -207,24 +207,24 @@ POP3account::POP3account() | |||
207 | : Account() | 207 | : Account() |
208 | { | 208 | { |
209 | file = POP3account::getUniqueFileName(); | 209 | file = POP3account::getUniqueFileName(); |
210 | accountName = "New POP3 Account"; | 210 | accountName = "New POP3 Account"; |
211 | ssl = false; | 211 | ssl = false; |
212 | connectionType = 1; | 212 | connectionType = 1; |
213 | type = "POP3"; | 213 | type = MAILLIB::A_POP3; |
214 | port = POP3_PORT; | 214 | port = POP3_PORT; |
215 | } | 215 | } |
216 | 216 | ||
217 | POP3account::POP3account( QString filename ) | 217 | POP3account::POP3account( QString filename ) |
218 | : Account() | 218 | : Account() |
219 | { | 219 | { |
220 | file = filename; | 220 | file = filename; |
221 | accountName = "New POP3 Account"; | 221 | accountName = "New POP3 Account"; |
222 | ssl = false; | 222 | ssl = false; |
223 | connectionType = 1; | 223 | connectionType = 1; |
224 | type = "POP3"; | 224 | type = MAILLIB::A_POP3; |
225 | port = POP3_PORT; | 225 | port = POP3_PORT; |
226 | } | 226 | } |
227 | 227 | ||
228 | QString POP3account::getUniqueFileName() | 228 | QString POP3account::getUniqueFileName() |
229 | { | 229 | { |
230 | int num = 0; | 230 | int num = 0; |
@@ -288,25 +288,25 @@ SMTPaccount::SMTPaccount() | |||
288 | ssl = false; | 288 | ssl = false; |
289 | connectionType = 1; | 289 | connectionType = 1; |
290 | login = false; | 290 | login = false; |
291 | useCC = false; | 291 | useCC = false; |
292 | useBCC = false; | 292 | useBCC = false; |
293 | useReply = false; | 293 | useReply = false; |
294 | type = "SMTP"; | 294 | type = MAILLIB::A_SMTP; |
295 | port = SMTP_PORT; | 295 | port = SMTP_PORT; |
296 | } | 296 | } |
297 | 297 | ||
298 | SMTPaccount::SMTPaccount( QString filename ) | 298 | SMTPaccount::SMTPaccount( QString filename ) |
299 | : Account() | 299 | : Account() |
300 | { | 300 | { |
301 | file = filename; | 301 | file = filename; |
302 | accountName = "New SMTP Account"; | 302 | accountName = "New SMTP Account"; |
303 | ssl = false; | 303 | ssl = false; |
304 | connectionType = 1; | 304 | connectionType = 1; |
305 | login = false; | 305 | login = false; |
306 | type = "SMTP"; | 306 | type = MAILLIB::A_SMTP; |
307 | port = SMTP_PORT; | 307 | port = SMTP_PORT; |
308 | } | 308 | } |
309 | 309 | ||
310 | QString SMTPaccount::getUniqueFileName() | 310 | QString SMTPaccount::getUniqueFileName() |
311 | { | 311 | { |
312 | int num = 0; | 312 | int num = 0; |
@@ -366,24 +366,24 @@ NNTPaccount::NNTPaccount() | |||
366 | : Account() | 366 | : Account() |
367 | { | 367 | { |
368 | file = NNTPaccount::getUniqueFileName(); | 368 | file = NNTPaccount::getUniqueFileName(); |
369 | accountName = "New NNTP Account"; | 369 | accountName = "New NNTP Account"; |
370 | ssl = false; | 370 | ssl = false; |
371 | login = false; | 371 | login = false; |
372 | type = "NNTP"; | 372 | type = MAILLIB::A_NNTP; |
373 | port = NNTP_PORT; | 373 | port = NNTP_PORT; |
374 | } | 374 | } |
375 | 375 | ||
376 | NNTPaccount::NNTPaccount( QString filename ) | 376 | NNTPaccount::NNTPaccount( QString filename ) |
377 | : Account() | 377 | : Account() |
378 | { | 378 | { |
379 | file = filename; | 379 | file = filename; |
380 | accountName = "New NNTP Account"; | 380 | accountName = "New NNTP Account"; |
381 | ssl = false; | 381 | ssl = false; |
382 | login = false; | 382 | login = false; |
383 | type = "NNTP"; | 383 | type = MAILLIB::A_NNTP; |
384 | port = NNTP_PORT; | 384 | port = NNTP_PORT; |
385 | } | 385 | } |
386 | 386 | ||
387 | QString NNTPaccount::getUniqueFileName() | 387 | QString NNTPaccount::getUniqueFileName() |
388 | { | 388 | { |
389 | int num = 0; | 389 | int num = 0; |
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index 1feedbf..27e2823 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h | |||
@@ -1,9 +1,11 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #include "maildefines.h" | ||
5 | |||
4 | #include <qobject.h> | 6 | #include <qobject.h> |
5 | #include <qlist.h> | 7 | #include <qlist.h> |
6 | 8 | ||
7 | class Account | 9 | class Account |
8 | { | 10 | { |
9 | 11 | ||
@@ -11,13 +13,13 @@ public: | |||
11 | Account(); | 13 | Account(); |
12 | virtual ~Account() {} | 14 | virtual ~Account() {} |
13 | 15 | ||
14 | void remove(); | 16 | void remove(); |
15 | void setAccountName( QString name ) { accountName = name; } | 17 | void setAccountName( QString name ) { accountName = name; } |
16 | const QString&getAccountName()const{ return accountName; } | 18 | const QString&getAccountName()const{ return accountName; } |
17 | const QString&getType()const{ return type; } | 19 | MAILLIB::ATYPE getType()const{ return type; } |
18 | 20 | ||
19 | void setServer(const QString&str){ server = str; } | 21 | void setServer(const QString&str){ server = str; } |
20 | const QString&getServer()const{ return server; } | 22 | const QString&getServer()const{ return server; } |
21 | 23 | ||
22 | void setPort(const QString&str) { port = str; } | 24 | void setPort(const QString&str) { port = str; } |
23 | const QString&getPort()const{ return port; } | 25 | const QString&getPort()const{ return port; } |
@@ -38,18 +40,19 @@ public: | |||
38 | void setOffline(bool b) {offline = b;} | 40 | void setOffline(bool b) {offline = b;} |
39 | bool getOffline()const{return offline;} | 41 | bool getOffline()const{return offline;} |
40 | 42 | ||
41 | virtual QString getFileName() { return accountName; } | 43 | virtual QString getFileName() { return accountName; } |
42 | virtual void read() { qDebug( "base reading..." ); } | 44 | virtual void read() { qDebug( "base reading..." ); } |
43 | virtual void save() { qDebug( "base saving..." ); } | 45 | virtual void save() { qDebug( "base saving..." ); } |
44 | 46 | ||
45 | protected: | 47 | protected: |
46 | QString accountName, type, server, port, user, password; | 48 | QString accountName, server, port, user, password; |
47 | bool ssl; | 49 | bool ssl; |
48 | int connectionType; | 50 | int connectionType; |
49 | bool offline; | 51 | bool offline; |
52 | MAILLIB::ATYPE type; | ||
50 | }; | 53 | }; |
51 | 54 | ||
52 | class IMAPaccount : public Account | 55 | class IMAPaccount : public Account |
53 | { | 56 | { |
54 | 57 | ||
55 | public: | 58 | public: |
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp index 4134e79..b78244d 100644 --- a/noncore/net/mail/libmailwrapper/statusmail.cpp +++ b/noncore/net/mail/libmailwrapper/statusmail.cpp | |||
@@ -23,21 +23,21 @@ void StatusMail::initAccounts(QList<Account>&accounts) | |||
23 | folderStat currentStat; | 23 | folderStat currentStat; |
24 | AbstractMail * current = 0; | 24 | AbstractMail * current = 0; |
25 | currentPop3Stat.message_count=0; | 25 | currentPop3Stat.message_count=0; |
26 | currentPop3Stat.message_recent=0; | 26 | currentPop3Stat.message_recent=0; |
27 | currentPop3Stat.message_unseen=0; | 27 | currentPop3Stat.message_unseen=0; |
28 | for ( it = accounts.first(); it; it = accounts.next() ) { | 28 | for ( it = accounts.first(); it; it = accounts.next() ) { |
29 | if ( it->getType().compare( "IMAP" ) == 0 && !it->getOffline() ) { | 29 | if ( it->getType()==MAILLIB::A_IMAP && !it->getOffline() ) { |
30 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); | 30 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); |
31 | current = AbstractMail::getWrapper(ima); | 31 | current = AbstractMail::getWrapper(ima); |
32 | connectionList.append(current); | 32 | connectionList.append(current); |
33 | current->statusFolder(currentStat); | 33 | current->statusFolder(currentStat); |
34 | currentImapStat.message_count+=currentStat.message_unseen; | 34 | currentImapStat.message_count+=currentStat.message_unseen; |
35 | currentImapStat.message_count+=currentStat.message_recent; | 35 | currentImapStat.message_count+=currentStat.message_recent; |
36 | currentImapStat.message_count+=currentStat.message_count; | 36 | currentImapStat.message_count+=currentStat.message_count; |
37 | } else if ( it->getType().compare( "POP3" ) == 0 && !it->getOffline() ) { | 37 | } else if ( it->getType() == MAILLIB::A_POP3 && !it->getOffline() ) { |
38 | POP3account *pop3 = static_cast<POP3account *>(it); | 38 | POP3account *pop3 = static_cast<POP3account *>(it); |
39 | current = AbstractMail::getWrapper(pop3); | 39 | current = AbstractMail::getWrapper(pop3); |
40 | connectionList.append(current); | 40 | connectionList.append(current); |
41 | current->statusFolder(currentStat); | 41 | current->statusFolder(currentStat); |
42 | currentPop3Stat.message_count+=currentStat.message_count; | 42 | currentPop3Stat.message_count+=currentStat.message_count; |
43 | } | 43 | } |
@@ -63,17 +63,17 @@ void StatusMail::check_current_stat(folderStat&targetStat) | |||
63 | currentPop3Stat.message_count = 0; | 63 | currentPop3Stat.message_count = 0; |
64 | currentPop3Stat.message_unseen = 0; | 64 | currentPop3Stat.message_unseen = 0; |
65 | currentImapStat = currentPop3Stat; | 65 | currentImapStat = currentPop3Stat; |
66 | for ( it = connectionList.first(); it; it = connectionList.next() ) { | 66 | for ( it = connectionList.first(); it; it = connectionList.next() ) { |
67 | it->statusFolder(currentStat); | 67 | it->statusFolder(currentStat); |
68 | it->logout(); | 68 | it->logout(); |
69 | if (it->getType().lower()=="imap") { | 69 | if (it->getType() == MAILLIB::A_IMAP) { |
70 | currentImapStat.message_unseen+=currentStat.message_unseen; | 70 | currentImapStat.message_unseen+=currentStat.message_unseen; |
71 | currentImapStat.message_recent+=currentStat.message_recent; | 71 | currentImapStat.message_recent+=currentStat.message_recent; |
72 | currentImapStat.message_count+=currentStat.message_count; | 72 | currentImapStat.message_count+=currentStat.message_count; |
73 | } else if (it->getType().lower()=="pop3") { | 73 | } else if (it->getType() == MAILLIB::A_POP3) { |
74 | currentPop3Stat.message_count+=currentStat.message_count; | 74 | currentPop3Stat.message_count+=currentStat.message_count; |
75 | qDebug("Pop3 count: %i",currentPop3Stat.message_count); | 75 | qDebug("Pop3 count: %i",currentPop3Stat.message_count); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | qDebug("Pop3 last: %i",lastPop3Stat.message_count); | 78 | qDebug("Pop3 last: %i",lastPop3Stat.message_count); |
79 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { | 79 | if (currentPop3Stat.message_count > lastPop3Stat.message_count) { |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 6bfc824..d8b58b6 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -79,13 +79,13 @@ void OpieMail::slotSendQueued() | |||
79 | QList<Account> list = settings->getAccounts(); | 79 | QList<Account> list = settings->getAccounts(); |
80 | QList<SMTPaccount> smtpList; | 80 | QList<SMTPaccount> smtpList; |
81 | smtpList.setAutoDelete(false); | 81 | smtpList.setAutoDelete(false); |
82 | Account *it; | 82 | Account *it; |
83 | for ( it = list.first(); it; it = list.next() ) | 83 | for ( it = list.first(); it; it = list.next() ) |
84 | { | 84 | { |
85 | if ( it->getType().compare( "SMTP" ) == 0 ) | 85 | if ( it->getType() == MAILLIB::A_SMTP ) |
86 | { | 86 | { |
87 | smtp = static_cast<SMTPaccount *>(it); | 87 | smtp = static_cast<SMTPaccount *>(it); |
88 | smtpList.append(smtp); | 88 | smtpList.append(smtp); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | if (smtpList.count()==0) | 91 | if (smtpList.count()==0) |