author | alwin <alwin> | 2004-04-04 23:47:04 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-04 23:47:04 (UTC) |
commit | 7485cd42befd86ad035ef4fa29d6e8f728b1e211 (patch) (unidiff) | |
tree | fffb498e97013a953f47652e9aa17c3def4c8a9b /noncore/net/mail/libmailwrapper | |
parent | fb8ce053c0f08769d359fe4153785e3de72f83ea (diff) | |
download | opie-7485cd42befd86ad035ef4fa29d6e8f728b1e211.zip opie-7485cd42befd86ad035ef4fa29d6e8f728b1e211.tar.gz opie-7485cd42befd86ad035ef4fa29d6e8f728b1e211.tar.bz2 |
someone forget to include opie2/odebug while switching from qDebug
to odebug ;)
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/generatemail.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/logindialog.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 3 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 3 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/statusmail.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/storemail.cpp | 2 |
14 files changed, 27 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 1a26351..7c1c0e4 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -1,55 +1,57 @@ | |||
1 | #include "abstractmail.h" | 1 | #include "abstractmail.h" |
2 | #include "imapwrapper.h" | 2 | #include "imapwrapper.h" |
3 | #include "pop3wrapper.h" | 3 | #include "pop3wrapper.h" |
4 | #include "nntpwrapper.h" | 4 | #include "nntpwrapper.h" |
5 | #include "mhwrapper.h" | 5 | #include "mhwrapper.h" |
6 | #include "mailtypes.h" | 6 | #include "mailtypes.h" |
7 | 7 | ||
8 | #include <opie2/odebug.h> | ||
9 | |||
8 | #include <qfile.h> | 10 | #include <qfile.h> |
9 | #include <qtextstream.h> | 11 | #include <qtextstream.h> |
10 | #include <stdlib.h> | 12 | #include <stdlib.h> |
11 | #include <libetpan/mailmime_content.h> | 13 | #include <libetpan/mailmime_content.h> |
12 | #include <libetpan/mailmime.h> | 14 | #include <libetpan/mailmime.h> |
13 | 15 | ||
14 | using namespace Opie::Core; | 16 | using namespace Opie::Core; |
15 | AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) | 17 | AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) |
16 | { | 18 | { |
17 | return new IMAPwrapper(a); | 19 | return new IMAPwrapper(a); |
18 | } | 20 | } |
19 | 21 | ||
20 | AbstractMail* AbstractMail::getWrapper(POP3account *a) | 22 | AbstractMail* AbstractMail::getWrapper(POP3account *a) |
21 | { | 23 | { |
22 | return new POP3wrapper(a); | 24 | return new POP3wrapper(a); |
23 | } | 25 | } |
24 | 26 | ||
25 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) | 27 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) |
26 | { | 28 | { |
27 | return new NNTPwrapper(a); | 29 | return new NNTPwrapper(a); |
28 | } | 30 | } |
29 | 31 | ||
30 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) | 32 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) |
31 | { | 33 | { |
32 | return new MHwrapper(a,name); | 34 | return new MHwrapper(a,name); |
33 | } | 35 | } |
34 | 36 | ||
35 | AbstractMail* AbstractMail::getWrapper(Account*a) | 37 | AbstractMail* AbstractMail::getWrapper(Account*a) |
36 | { | 38 | { |
37 | if (!a) return 0; | 39 | if (!a) return 0; |
38 | switch (a->getType()) { | 40 | switch (a->getType()) { |
39 | case MAILLIB::A_IMAP: | 41 | case MAILLIB::A_IMAP: |
40 | return new IMAPwrapper((IMAPaccount*)a); | 42 | return new IMAPwrapper((IMAPaccount*)a); |
41 | break; | 43 | break; |
42 | case MAILLIB::A_POP3: | 44 | case MAILLIB::A_POP3: |
43 | return new POP3wrapper((POP3account*)a); | 45 | return new POP3wrapper((POP3account*)a); |
44 | break; | 46 | break; |
45 | case MAILLIB::A_NNTP: | 47 | case MAILLIB::A_NNTP: |
46 | return new NNTPwrapper((NNTPaccount*)a); | 48 | return new NNTPwrapper((NNTPaccount*)a); |
47 | break; | 49 | break; |
48 | default: | 50 | default: |
49 | return 0; | 51 | return 0; |
50 | } | 52 | } |
51 | } | 53 | } |
52 | 54 | ||
53 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) | 55 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
54 | { | 56 | { |
55 | odebug << "Decode string start" << oendl; | 57 | odebug << "Decode string start" << oendl; |
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp index 36ec232..eb322a7 100644 --- a/noncore/net/mail/libmailwrapper/generatemail.cpp +++ b/noncore/net/mail/libmailwrapper/generatemail.cpp | |||
@@ -1,53 +1,55 @@ | |||
1 | #include "generatemail.h" | 1 | #include "generatemail.h" |
2 | #include "mailwrapper.h" | 2 | #include "mailwrapper.h" |
3 | 3 | ||
4 | #include <libetpan/libetpan.h> | 4 | #include <libetpan/libetpan.h> |
5 | 5 | ||
6 | #include <opie2/odebug.h> | ||
7 | |||
6 | #include <qt.h> | 8 | #include <qt.h> |
7 | 9 | ||
8 | using namespace Opie::Core; | 10 | using namespace Opie::Core; |
9 | const char* Generatemail::USER_AGENT="OpieMail v0.6"; | 11 | const char* Generatemail::USER_AGENT="OpieMail v0.6"; |
10 | 12 | ||
11 | Generatemail::Generatemail() | 13 | Generatemail::Generatemail() |
12 | { | 14 | { |
13 | } | 15 | } |
14 | 16 | ||
15 | Generatemail::~Generatemail() | 17 | Generatemail::~Generatemail() |
16 | { | 18 | { |
17 | } | 19 | } |
18 | 20 | ||
19 | void Generatemail::addRcpts( clist *list, mailimf_address_list *addr_list ) { | 21 | void Generatemail::addRcpts( clist *list, mailimf_address_list *addr_list ) { |
20 | clistiter *it, *it2; | 22 | clistiter *it, *it2; |
21 | 23 | ||
22 | for ( it = clist_begin( addr_list->ad_list ); it; it = it->next ) { | 24 | for ( it = clist_begin( addr_list->ad_list ); it; it = it->next ) { |
23 | mailimf_address *addr; | 25 | mailimf_address *addr; |
24 | addr = (mailimf_address *) it->data; | 26 | addr = (mailimf_address *) it->data; |
25 | 27 | ||
26 | if ( addr->ad_type == MAILIMF_ADDRESS_MAILBOX ) { | 28 | if ( addr->ad_type == MAILIMF_ADDRESS_MAILBOX ) { |
27 | esmtp_address_list_add( list, addr->ad_data.ad_mailbox->mb_addr_spec, 0, NULL ); | 29 | esmtp_address_list_add( list, addr->ad_data.ad_mailbox->mb_addr_spec, 0, NULL ); |
28 | } else if ( addr->ad_type == MAILIMF_ADDRESS_GROUP ) { | 30 | } else if ( addr->ad_type == MAILIMF_ADDRESS_GROUP ) { |
29 | clist *l = addr->ad_data.ad_group->grp_mb_list->mb_list; | 31 | clist *l = addr->ad_data.ad_group->grp_mb_list->mb_list; |
30 | for ( it2 = clist_begin( l ); it2; it2 = it2->next ) { | 32 | for ( it2 = clist_begin( l ); it2; it2 = it2->next ) { |
31 | mailimf_mailbox *mbox; | 33 | mailimf_mailbox *mbox; |
32 | mbox = (mailimf_mailbox *) it2->data; | 34 | mbox = (mailimf_mailbox *) it2->data; |
33 | esmtp_address_list_add( list, mbox->mb_addr_spec, 0, NULL ); | 35 | esmtp_address_list_add( list, mbox->mb_addr_spec, 0, NULL ); |
34 | } | 36 | } |
35 | } | 37 | } |
36 | } | 38 | } |
37 | } | 39 | } |
38 | 40 | ||
39 | char *Generatemail::getFrom( mailimf_field *ffrom) { | 41 | char *Generatemail::getFrom( mailimf_field *ffrom) { |
40 | char *from = NULL; | 42 | char *from = NULL; |
41 | if ( ffrom && (ffrom->fld_type == MAILIMF_FIELD_FROM) | 43 | if ( ffrom && (ffrom->fld_type == MAILIMF_FIELD_FROM) |
42 | && ffrom->fld_data.fld_from->frm_mb_list && ffrom->fld_data.fld_from->frm_mb_list->mb_list ) { | 44 | && ffrom->fld_data.fld_from->frm_mb_list && ffrom->fld_data.fld_from->frm_mb_list->mb_list ) { |
43 | clist *cl = ffrom->fld_data.fld_from->frm_mb_list->mb_list; | 45 | clist *cl = ffrom->fld_data.fld_from->frm_mb_list->mb_list; |
44 | clistiter *it; | 46 | clistiter *it; |
45 | for ( it = clist_begin( cl ); it; it = it->next ) { | 47 | for ( it = clist_begin( cl ); it; it = it->next ) { |
46 | mailimf_mailbox *mb = (mailimf_mailbox *) it->data; | 48 | mailimf_mailbox *mb = (mailimf_mailbox *) it->data; |
47 | from = strdup( mb->mb_addr_spec ); | 49 | from = strdup( mb->mb_addr_spec ); |
48 | } | 50 | } |
49 | } | 51 | } |
50 | 52 | ||
51 | return from; | 53 | return from; |
52 | } | 54 | } |
53 | 55 | ||
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index fae4c99..3e4293b 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -1,52 +1,54 @@ | |||
1 | #include "genericwrapper.h" | 1 | #include "genericwrapper.h" |
2 | #include <libetpan/libetpan.h> | 2 | #include <libetpan/libetpan.h> |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | 4 | ||
5 | #include <opie2/odebug.h> | ||
6 | |||
5 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
6 | Genericwrapper::Genericwrapper() | 8 | Genericwrapper::Genericwrapper() |
7 | : AbstractMail() | 9 | : AbstractMail() |
8 | { | 10 | { |
9 | bodyCache.clear(); | 11 | bodyCache.clear(); |
10 | m_storage = 0; | 12 | m_storage = 0; |
11 | m_folder = 0; | 13 | m_folder = 0; |
12 | } | 14 | } |
13 | 15 | ||
14 | Genericwrapper::~Genericwrapper() | 16 | Genericwrapper::~Genericwrapper() |
15 | { | 17 | { |
16 | if (m_folder) { | 18 | if (m_folder) { |
17 | mailfolder_free(m_folder); | 19 | mailfolder_free(m_folder); |
18 | } | 20 | } |
19 | if (m_storage) { | 21 | if (m_storage) { |
20 | mailstorage_free(m_storage); | 22 | mailstorage_free(m_storage); |
21 | } | 23 | } |
22 | cleanMimeCache(); | 24 | cleanMimeCache(); |
23 | } | 25 | } |
24 | 26 | ||
25 | void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) | 27 | void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) |
26 | { | 28 | { |
27 | if (!mime) { | 29 | if (!mime) { |
28 | return; | 30 | return; |
29 | } | 31 | } |
30 | mailmime_field*field = 0; | 32 | mailmime_field*field = 0; |
31 | mailmime_single_fields fields; | 33 | mailmime_single_fields fields; |
32 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); | 34 | memset(&fields, 0, sizeof(struct mailmime_single_fields)); |
33 | if (mime->mm_mime_fields != NULL) { | 35 | if (mime->mm_mime_fields != NULL) { |
34 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, | 36 | mailmime_single_fields_init(&fields, mime->mm_mime_fields, |
35 | mime->mm_content_type); | 37 | mime->mm_content_type); |
36 | } | 38 | } |
37 | 39 | ||
38 | mailmime_content*type = fields.fld_content; | 40 | mailmime_content*type = fields.fld_content; |
39 | clistcell*current; | 41 | clistcell*current; |
40 | if (!type) { | 42 | if (!type) { |
41 | target->setType("text"); | 43 | target->setType("text"); |
42 | target->setSubtype("plain"); | 44 | target->setSubtype("plain"); |
43 | } else { | 45 | } else { |
44 | target->setSubtype(type->ct_subtype); | 46 | target->setSubtype(type->ct_subtype); |
45 | switch(type->ct_type->tp_data.tp_discrete_type->dt_type) { | 47 | switch(type->ct_type->tp_data.tp_discrete_type->dt_type) { |
46 | case MAILMIME_DISCRETE_TYPE_TEXT: | 48 | case MAILMIME_DISCRETE_TYPE_TEXT: |
47 | target->setType("text"); | 49 | target->setType("text"); |
48 | break; | 50 | break; |
49 | case MAILMIME_DISCRETE_TYPE_IMAGE: | 51 | case MAILMIME_DISCRETE_TYPE_IMAGE: |
50 | target->setType("image"); | 52 | target->setType("image"); |
51 | break; | 53 | break; |
52 | case MAILMIME_DISCRETE_TYPE_AUDIO: | 54 | case MAILMIME_DISCRETE_TYPE_AUDIO: |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 35468fe..9b7c0e0 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -1,52 +1,53 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <libetpan/libetpan.h> | 2 | #include <libetpan/libetpan.h> |
3 | #include <qpe/global.h> | 3 | #include <qpe/global.h> |
4 | #include <opie2/oapplication.h> | 4 | #include <opie2/oapplication.h> |
5 | #include <opie2/odebug.h> | ||
5 | 6 | ||
6 | #include "imapwrapper.h" | 7 | #include "imapwrapper.h" |
7 | #include "mailtypes.h" | 8 | #include "mailtypes.h" |
8 | #include "logindialog.h" | 9 | #include "logindialog.h" |
9 | 10 | ||
10 | using namespace Opie::Core; | 11 | using namespace Opie::Core; |
11 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) | 12 | IMAPwrapper::IMAPwrapper( IMAPaccount *a ) |
12 | : AbstractMail() | 13 | : AbstractMail() |
13 | { | 14 | { |
14 | account = a; | 15 | account = a; |
15 | m_imap = 0; | 16 | m_imap = 0; |
16 | m_Lastmbox = ""; | 17 | m_Lastmbox = ""; |
17 | } | 18 | } |
18 | 19 | ||
19 | IMAPwrapper::~IMAPwrapper() | 20 | IMAPwrapper::~IMAPwrapper() |
20 | { | 21 | { |
21 | logout(); | 22 | logout(); |
22 | } | 23 | } |
23 | 24 | ||
24 | /* to avoid to often select statements in loops etc. | 25 | /* to avoid to often select statements in loops etc. |
25 | we trust that we are logged in and connection is established!*/ | 26 | we trust that we are logged in and connection is established!*/ |
26 | int IMAPwrapper::selectMbox(const QString&mbox) | 27 | int IMAPwrapper::selectMbox(const QString&mbox) |
27 | { | 28 | { |
28 | if (mbox == m_Lastmbox) { | 29 | if (mbox == m_Lastmbox) { |
29 | return MAILIMAP_NO_ERROR; | 30 | return MAILIMAP_NO_ERROR; |
30 | } | 31 | } |
31 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); | 32 | int err = mailimap_select( m_imap, (char*)mbox.latin1()); |
32 | if ( err != MAILIMAP_NO_ERROR ) { | 33 | if ( err != MAILIMAP_NO_ERROR ) { |
33 | odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; | 34 | odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; |
34 | m_Lastmbox = ""; | 35 | m_Lastmbox = ""; |
35 | return err; | 36 | return err; |
36 | } | 37 | } |
37 | m_Lastmbox = mbox; | 38 | m_Lastmbox = mbox; |
38 | return err; | 39 | return err; |
39 | } | 40 | } |
40 | 41 | ||
41 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) | 42 | void IMAPwrapper::imap_progress( size_t current, size_t maximum ) |
42 | { | 43 | { |
43 | qApp->processEvents(); | 44 | qApp->processEvents(); |
44 | odebug << "IMAP: " << current << " of " << maximum << "" << oendl; | 45 | odebug << "IMAP: " << current << " of " << maximum << "" << oendl; |
45 | } | 46 | } |
46 | 47 | ||
47 | bool IMAPwrapper::start_tls(bool force_tls) | 48 | bool IMAPwrapper::start_tls(bool force_tls) |
48 | { | 49 | { |
49 | int err; | 50 | int err; |
50 | bool try_tls; | 51 | bool try_tls; |
51 | mailimap_capability_data * cap_data = 0; | 52 | mailimap_capability_data * cap_data = 0; |
52 | 53 | ||
diff --git a/noncore/net/mail/libmailwrapper/logindialog.cpp b/noncore/net/mail/libmailwrapper/logindialog.cpp index c9ae190..ce705b2 100644 --- a/noncore/net/mail/libmailwrapper/logindialog.cpp +++ b/noncore/net/mail/libmailwrapper/logindialog.cpp | |||
@@ -1,29 +1,33 @@ | |||
1 | #include <qlineedit.h> | 1 | #include <qlineedit.h> |
2 | 2 | ||
3 | #include "logindialog.h" | 3 | #include "logindialog.h" |
4 | 4 | ||
5 | #include <opie2/odebug.h> | ||
6 | |||
7 | using namespace Opie::Core; | ||
8 | |||
5 | LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) | 9 | LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) |
6 | : LoginDialogUI( parent, name, modal, flags ) | 10 | : LoginDialogUI( parent, name, modal, flags ) |
7 | { | 11 | { |
8 | userLine->setText( (user.isEmpty()?QString(""):user) ); | 12 | userLine->setText( (user.isEmpty()?QString(""):user) ); |
9 | passLine->setText( (pass.isEmpty()?QString(""):pass) ); | 13 | passLine->setText( (pass.isEmpty()?QString(""):pass) ); |
10 | _user = user; | 14 | _user = user; |
11 | _pass = pass; | 15 | _pass = pass; |
12 | 16 | ||
13 | if ( user.isEmpty() ) { | 17 | if ( user.isEmpty() ) { |
14 | userLine->setFocus(); | 18 | userLine->setFocus(); |
15 | } else { | 19 | } else { |
16 | passLine->setFocus(); | 20 | passLine->setFocus(); |
17 | } | 21 | } |
18 | } | 22 | } |
19 | 23 | ||
20 | void LoginDialog::accept() | 24 | void LoginDialog::accept() |
21 | { | 25 | { |
22 | //_user.replace( 0, _user.length(), userLine->text() ); | 26 | //_user.replace( 0, _user.length(), userLine->text() ); |
23 | //_pass.replace( 0, _pass.length(), passLine->text() ); | 27 | //_pass.replace( 0, _pass.length(), passLine->text() ); |
24 | _user = userLine->text(); | 28 | _user = userLine->text(); |
25 | _pass = passLine->text(); | 29 | _pass = passLine->text(); |
26 | 30 | ||
27 | odebug << "User im accept: |" << _user.latin1() << "|" << oendl; | 31 | odebug << "User im accept: |" << _user.latin1() << "|" << oendl; |
28 | QDialog::accept(); | 32 | QDialog::accept(); |
29 | } | 33 | } |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 6d44db4..d4395a2 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -1,49 +1,52 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | |||
3 | #include <opie2/odebug.h> | ||
4 | |||
2 | #include <stdlib.h> | 5 | #include <stdlib.h> |
3 | 6 | ||
4 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
5 | RecMail::RecMail() | 8 | RecMail::RecMail() |
6 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
7 | { | 10 | { |
8 | init(); | 11 | init(); |
9 | } | 12 | } |
10 | 13 | ||
11 | RecMail::RecMail(const RecMail&old) | 14 | RecMail::RecMail(const RecMail&old) |
12 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 15 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
13 | { | 16 | { |
14 | init(); | 17 | init(); |
15 | copy_old(old); | 18 | copy_old(old); |
16 | odebug << "Copy constructor RecMail" << oendl; | 19 | odebug << "Copy constructor RecMail" << oendl; |
17 | } | 20 | } |
18 | 21 | ||
19 | RecMail::~RecMail() | 22 | RecMail::~RecMail() |
20 | { | 23 | { |
21 | wrapper = 0; | 24 | wrapper = 0; |
22 | } | 25 | } |
23 | 26 | ||
24 | void RecMail::copy_old(const RecMail&old) | 27 | void RecMail::copy_old(const RecMail&old) |
25 | { | 28 | { |
26 | subject = old.subject; | 29 | subject = old.subject; |
27 | date = old.date; | 30 | date = old.date; |
28 | mbox = old.mbox; | 31 | mbox = old.mbox; |
29 | msg_id = old.msg_id; | 32 | msg_id = old.msg_id; |
30 | msg_size = old.msg_size; | 33 | msg_size = old.msg_size; |
31 | msg_number = old.msg_number; | 34 | msg_number = old.msg_number; |
32 | from = old.from; | 35 | from = old.from; |
33 | msg_flags = old.msg_flags; | 36 | msg_flags = old.msg_flags; |
34 | to = old.to; | 37 | to = old.to; |
35 | cc = old.cc; | 38 | cc = old.cc; |
36 | bcc = old.bcc; | 39 | bcc = old.bcc; |
37 | wrapper = old.wrapper; | 40 | wrapper = old.wrapper; |
38 | in_reply_to = old.in_reply_to; | 41 | in_reply_to = old.in_reply_to; |
39 | references = old.references; | 42 | references = old.references; |
40 | replyto = old.replyto; | 43 | replyto = old.replyto; |
41 | } | 44 | } |
42 | 45 | ||
43 | void RecMail::init() | 46 | void RecMail::init() |
44 | { | 47 | { |
45 | to.clear(); | 48 | to.clear(); |
46 | cc.clear(); | 49 | cc.clear(); |
47 | bcc.clear(); | 50 | bcc.clear(); |
48 | in_reply_to.clear(); | 51 | in_reply_to.clear(); |
49 | references.clear(); | 52 | references.clear(); |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index df2112f..a030cca 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -1,54 +1,56 @@ | |||
1 | #include "mboxwrapper.h" | 1 | #include "mboxwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
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 | |||
8 | #include <opie2/odebug.h> | ||
7 | #include <qpe/global.h> | 9 | #include <qpe/global.h> |
8 | 10 | ||
9 | using namespace Opie::Core; | 11 | using namespace Opie::Core; |
10 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) | 12 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) |
11 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) | 13 | : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) |
12 | { | 14 | { |
13 | QDir dir(MBOXPath); | 15 | QDir dir(MBOXPath); |
14 | if (!dir.exists()) { | 16 | if (!dir.exists()) { |
15 | dir.mkdir(MBOXPath); | 17 | dir.mkdir(MBOXPath); |
16 | } | 18 | } |
17 | } | 19 | } |
18 | 20 | ||
19 | MBOXwrapper::~MBOXwrapper() | 21 | MBOXwrapper::~MBOXwrapper() |
20 | { | 22 | { |
21 | } | 23 | } |
22 | 24 | ||
23 | void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) | 25 | void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) |
24 | { | 26 | { |
25 | mailstorage*storage = mailstorage_new(NULL); | 27 | mailstorage*storage = mailstorage_new(NULL); |
26 | QString p = MBOXPath+"/"; | 28 | QString p = MBOXPath+"/"; |
27 | p+=mailbox; | 29 | p+=mailbox; |
28 | 30 | ||
29 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); | 31 | int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); |
30 | mailfolder*folder; | 32 | mailfolder*folder; |
31 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); | 33 | folder = mailfolder_new( storage,(char*)p.latin1(),NULL); |
32 | r = mailfolder_connect(folder); | 34 | r = mailfolder_connect(folder); |
33 | if (r != MAIL_NO_ERROR) { | 35 | if (r != MAIL_NO_ERROR) { |
34 | odebug << "Error initializing mbox" << oendl; | 36 | odebug << "Error initializing mbox" << oendl; |
35 | mailfolder_free(folder); | 37 | mailfolder_free(folder); |
36 | mailstorage_free(storage); | 38 | mailstorage_free(storage); |
37 | return; | 39 | return; |
38 | } | 40 | } |
39 | 41 | ||
40 | parseList(target,folder->fld_session,mailbox); | 42 | parseList(target,folder->fld_session,mailbox); |
41 | 43 | ||
42 | mailfolder_disconnect(folder); | 44 | mailfolder_disconnect(folder); |
43 | mailfolder_free(folder); | 45 | mailfolder_free(folder); |
44 | mailstorage_free(storage); | 46 | mailstorage_free(storage); |
45 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); | 47 | Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); |
46 | } | 48 | } |
47 | 49 | ||
48 | QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() | 50 | QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() |
49 | { | 51 | { |
50 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); | 52 | QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); |
51 | QDir dir(MBOXPath); | 53 | QDir dir(MBOXPath); |
52 | if (!dir.exists()) return folders; | 54 | if (!dir.exists()) return folders; |
53 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); | 55 | dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); |
54 | QStringList entries = dir.entryList(); | 56 | QStringList entries = dir.entryList(); |
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index cd7cecb..403afcf 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp | |||
@@ -1,57 +1,58 @@ | |||
1 | #include "mhwrapper.h" | 1 | #include "mhwrapper.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
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 <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 | #include <opie2/odebug.h> | ||
10 | 11 | ||
11 | using namespace Opie::Core; | 12 | using namespace Opie::Core; |
12 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) | 13 | MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) |
13 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) | 14 | : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) |
14 | { | 15 | { |
15 | if (MHPath.length()>0) { | 16 | if (MHPath.length()>0) { |
16 | if (MHPath[MHPath.length()-1]=='/') { | 17 | if (MHPath[MHPath.length()-1]=='/') { |
17 | MHPath=MHPath.left(MHPath.length()-1); | 18 | MHPath=MHPath.left(MHPath.length()-1); |
18 | } | 19 | } |
19 | odebug << MHPath << oendl; | 20 | odebug << MHPath << oendl; |
20 | QDir dir(MHPath); | 21 | QDir dir(MHPath); |
21 | if (!dir.exists()) { | 22 | if (!dir.exists()) { |
22 | dir.mkdir(MHPath); | 23 | dir.mkdir(MHPath); |
23 | } | 24 | } |
24 | init_storage(); | 25 | init_storage(); |
25 | } | 26 | } |
26 | } | 27 | } |
27 | 28 | ||
28 | void MHwrapper::init_storage() | 29 | void MHwrapper::init_storage() |
29 | { | 30 | { |
30 | int r; | 31 | int r; |
31 | QString pre = MHPath; | 32 | QString pre = MHPath; |
32 | if (!m_storage) { | 33 | if (!m_storage) { |
33 | m_storage = mailstorage_new(NULL); | 34 | m_storage = mailstorage_new(NULL); |
34 | r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); | 35 | r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); |
35 | if (r != MAIL_NO_ERROR) { | 36 | if (r != MAIL_NO_ERROR) { |
36 | odebug << "error initializing storage" << oendl; | 37 | odebug << "error initializing storage" << oendl; |
37 | mailstorage_free(m_storage); | 38 | mailstorage_free(m_storage); |
38 | m_storage = 0; | 39 | m_storage = 0; |
39 | return; | 40 | return; |
40 | } | 41 | } |
41 | } | 42 | } |
42 | r = mailstorage_connect(m_storage); | 43 | r = mailstorage_connect(m_storage); |
43 | if (r!=MAIL_NO_ERROR) { | 44 | if (r!=MAIL_NO_ERROR) { |
44 | odebug << "error connecting storage" << oendl; | 45 | odebug << "error connecting storage" << oendl; |
45 | mailstorage_free(m_storage); | 46 | mailstorage_free(m_storage); |
46 | m_storage = 0; | 47 | m_storage = 0; |
47 | } | 48 | } |
48 | } | 49 | } |
49 | 50 | ||
50 | void MHwrapper::clean_storage() | 51 | void MHwrapper::clean_storage() |
51 | { | 52 | { |
52 | if (m_storage) { | 53 | if (m_storage) { |
53 | mailstorage_disconnect(m_storage); | 54 | mailstorage_disconnect(m_storage); |
54 | mailstorage_free(m_storage); | 55 | mailstorage_free(m_storage); |
55 | m_storage = 0; | 56 | m_storage = 0; |
56 | } | 57 | } |
57 | } | 58 | } |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 5d5011a..c99b97c 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -1,58 +1,59 @@ | |||
1 | #include "nntpwrapper.h" | 1 | #include "nntpwrapper.h" |
2 | #include "logindialog.h" | 2 | #include "logindialog.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | 4 | ||
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | 6 | ||
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | 8 | ||
9 | #include <libetpan/libetpan.h> | 9 | #include <libetpan/libetpan.h> |
10 | 10 | ||
11 | #include <opie2/odebug.h> | ||
11 | 12 | ||
12 | #define HARD_MSG_SIZE_LIMIT 5242880 | 13 | #define HARD_MSG_SIZE_LIMIT 5242880 |
13 | 14 | ||
14 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
15 | NNTPwrapper::NNTPwrapper( NNTPaccount *a ) | 16 | NNTPwrapper::NNTPwrapper( NNTPaccount *a ) |
16 | : Genericwrapper() { | 17 | : Genericwrapper() { |
17 | account = a; | 18 | account = a; |
18 | m_nntp = NULL; | 19 | m_nntp = NULL; |
19 | msgTempName = a->getFileName()+"_msg_cache"; | 20 | msgTempName = a->getFileName()+"_msg_cache"; |
20 | last_msg_id = 0; | 21 | last_msg_id = 0; |
21 | } | 22 | } |
22 | 23 | ||
23 | NNTPwrapper::~NNTPwrapper() { | 24 | NNTPwrapper::~NNTPwrapper() { |
24 | logout(); | 25 | logout(); |
25 | QFile msg_cache(msgTempName); | 26 | QFile msg_cache(msgTempName); |
26 | if (msg_cache.exists()) { | 27 | if (msg_cache.exists()) { |
27 | msg_cache.remove(); | 28 | msg_cache.remove(); |
28 | } | 29 | } |
29 | } | 30 | } |
30 | 31 | ||
31 | void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { | 32 | void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { |
32 | odebug << "NNTP: " << current << " of " << maximum << "" << oendl; | 33 | odebug << "NNTP: " << current << " of " << maximum << "" << oendl; |
33 | } | 34 | } |
34 | 35 | ||
35 | 36 | ||
36 | RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { | 37 | RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { |
37 | int err = NEWSNNTP_NO_ERROR; | 38 | int err = NEWSNNTP_NO_ERROR; |
38 | char *message = 0; | 39 | char *message = 0; |
39 | size_t length = 0; | 40 | size_t length = 0; |
40 | 41 | ||
41 | RecBodyP body = new RecBody(); | 42 | RecBodyP body = new RecBody(); |
42 | login(); | 43 | login(); |
43 | if ( !m_nntp ) { | 44 | if ( !m_nntp ) { |
44 | return body; | 45 | return body; |
45 | } | 46 | } |
46 | 47 | ||
47 | mailmessage * mailmsg; | 48 | mailmessage * mailmsg; |
48 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { | 49 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
49 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; | 50 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; |
50 | return body; | 51 | return body; |
51 | } | 52 | } |
52 | 53 | ||
53 | QFile msg_cache(msgTempName); | 54 | QFile msg_cache(msgTempName); |
54 | 55 | ||
55 | cleanMimeCache(); | 56 | cleanMimeCache(); |
56 | 57 | ||
57 | if (mail->getNumber()!=last_msg_id) { | 58 | if (mail->getNumber()!=last_msg_id) { |
58 | if (msg_cache.exists()) { | 59 | if (msg_cache.exists()) { |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index c586c29..3cfd1ee 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -1,56 +1,57 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include "pop3wrapper.h" | 2 | #include "pop3wrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "logindialog.h" | 4 | #include "logindialog.h" |
5 | #include <libetpan/libetpan.h> | 5 | #include <libetpan/libetpan.h> |
6 | |||
7 | #include <opie2/odebug.h> | ||
6 | #include <qpe/global.h> | 8 | #include <qpe/global.h> |
7 | #include <qfile.h> | 9 | #include <qfile.h> |
8 | //#include <qstring.h> | ||
9 | 10 | ||
10 | /* we don't fetch messages larger than 5 MB */ | 11 | /* we don't fetch messages larger than 5 MB */ |
11 | #define HARD_MSG_SIZE_LIMIT 5242880 | 12 | #define HARD_MSG_SIZE_LIMIT 5242880 |
12 | 13 | ||
13 | using namespace Opie::Core; | 14 | using namespace Opie::Core; |
14 | POP3wrapper::POP3wrapper( POP3account *a ) | 15 | POP3wrapper::POP3wrapper( POP3account *a ) |
15 | : Genericwrapper() { | 16 | : Genericwrapper() { |
16 | account = a; | 17 | account = a; |
17 | m_pop3 = NULL; | 18 | m_pop3 = NULL; |
18 | msgTempName = a->getFileName()+"_msg_cache"; | 19 | msgTempName = a->getFileName()+"_msg_cache"; |
19 | last_msg_id = 0; | 20 | last_msg_id = 0; |
20 | } | 21 | } |
21 | 22 | ||
22 | POP3wrapper::~POP3wrapper() { | 23 | POP3wrapper::~POP3wrapper() { |
23 | logout(); | 24 | logout(); |
24 | QFile msg_cache(msgTempName); | 25 | QFile msg_cache(msgTempName); |
25 | if (msg_cache.exists()) { | 26 | if (msg_cache.exists()) { |
26 | msg_cache.remove(); | 27 | msg_cache.remove(); |
27 | } | 28 | } |
28 | } | 29 | } |
29 | 30 | ||
30 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { | 31 | void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { |
31 | odebug << "POP3: " << current << " of " << maximum << "" << oendl; | 32 | odebug << "POP3: " << current << " of " << maximum << "" << oendl; |
32 | } | 33 | } |
33 | 34 | ||
34 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { | 35 | RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { |
35 | int err = MAILPOP3_NO_ERROR; | 36 | int err = MAILPOP3_NO_ERROR; |
36 | char *message = 0; | 37 | char *message = 0; |
37 | size_t length = 0; | 38 | size_t length = 0; |
38 | 39 | ||
39 | RecBodyP body = new RecBody(); | 40 | RecBodyP body = new RecBody(); |
40 | 41 | ||
41 | login(); | 42 | login(); |
42 | if ( !m_pop3 ) { | 43 | if ( !m_pop3 ) { |
43 | return body; | 44 | return body; |
44 | } | 45 | } |
45 | 46 | ||
46 | mailmessage * mailmsg; | 47 | mailmessage * mailmsg; |
47 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { | 48 | if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { |
48 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; | 49 | odebug << "Message to large: " << mail->Msgsize() << "" << oendl; |
49 | return body; | 50 | return body; |
50 | } | 51 | } |
51 | 52 | ||
52 | QFile msg_cache(msgTempName); | 53 | QFile msg_cache(msgTempName); |
53 | 54 | ||
54 | cleanMimeCache(); | 55 | cleanMimeCache(); |
55 | 56 | ||
56 | if (mail->getNumber()!=last_msg_id) { | 57 | if (mail->getNumber()!=last_msg_id) { |
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index de36eeb..3c9b25c 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -1,51 +1,52 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | 3 | ||
4 | #include <opie2/odebug.h> | ||
4 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
5 | 6 | ||
6 | #include "settings.h" | 7 | #include "settings.h" |
7 | //#include "defines.h" | 8 | //#include "defines.h" |
8 | 9 | ||
9 | #define IMAP_PORT "143" | 10 | #define IMAP_PORT "143" |
10 | #define IMAP_SSL_PORT "993" | 11 | #define IMAP_SSL_PORT "993" |
11 | #define SMTP_PORT "25" | 12 | #define SMTP_PORT "25" |
12 | #define SMTP_SSL_PORT "465" | 13 | #define SMTP_SSL_PORT "465" |
13 | #define POP3_PORT "110" | 14 | #define POP3_PORT "110" |
14 | #define POP3_SSL_PORT "995" | 15 | #define POP3_SSL_PORT "995" |
15 | #define NNTP_PORT "119" | 16 | #define NNTP_PORT "119" |
16 | #define NNTP_SSL_PORT "563" | 17 | #define NNTP_SSL_PORT "563" |
17 | 18 | ||
18 | 19 | ||
19 | Settings::Settings() | 20 | Settings::Settings() |
20 | : QObject() | 21 | : QObject() |
21 | { | 22 | { |
22 | updateAccounts(); | 23 | updateAccounts(); |
23 | } | 24 | } |
24 | 25 | ||
25 | void Settings::checkDirectory() | 26 | void Settings::checkDirectory() |
26 | { | 27 | { |
27 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { | 28 | if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { |
28 | system( "mkdir -p $HOME/Applications/opiemail" ); | 29 | system( "mkdir -p $HOME/Applications/opiemail" ); |
29 | odebug << "$HOME/Applications/opiemail created" << oendl; | 30 | odebug << "$HOME/Applications/opiemail created" << oendl; |
30 | } | 31 | } |
31 | } | 32 | } |
32 | 33 | ||
33 | QList<Account> Settings::getAccounts() | 34 | QList<Account> Settings::getAccounts() |
34 | { | 35 | { |
35 | return accounts; | 36 | return accounts; |
36 | } | 37 | } |
37 | 38 | ||
38 | void Settings::addAccount( Account *account ) | 39 | void Settings::addAccount( Account *account ) |
39 | { | 40 | { |
40 | accounts.append( account ); | 41 | accounts.append( account ); |
41 | } | 42 | } |
42 | 43 | ||
43 | void Settings::delAccount( Account *account ) | 44 | void Settings::delAccount( Account *account ) |
44 | { | 45 | { |
45 | accounts.remove( account ); | 46 | accounts.remove( account ); |
46 | account->remove(); | 47 | account->remove(); |
47 | } | 48 | } |
48 | 49 | ||
49 | void Settings::updateAccounts() | 50 | void Settings::updateAccounts() |
50 | { | 51 | { |
51 | accounts.clear(); | 52 | accounts.clear(); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index ba78c3b..db7a8ee 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -1,55 +1,56 @@ | |||
1 | #include "smtpwrapper.h" | 1 | #include "smtpwrapper.h" |
2 | #include "mailwrapper.h" | 2 | #include "mailwrapper.h" |
3 | #include "abstractmail.h" | 3 | #include "abstractmail.h" |
4 | #include "logindialog.h" | 4 | #include "logindialog.h" |
5 | #include "mailtypes.h" | 5 | #include "mailtypes.h" |
6 | #include "sendmailprogress.h" | 6 | #include "sendmailprogress.h" |
7 | 7 | ||
8 | #include <opie2/odebug.h> | ||
8 | #include <qt.h> | 9 | #include <qt.h> |
9 | 10 | ||
10 | #include <qpe/config.h> | 11 | #include <qpe/config.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 12 | #include <qpe/qcopenvelope_qws.h> |
12 | 13 | ||
13 | #include <libetpan/libetpan.h> | 14 | #include <libetpan/libetpan.h> |
14 | 15 | ||
15 | 16 | ||
16 | using namespace Opie::Core; | 17 | using namespace Opie::Core; |
17 | progressMailSend*SMTPwrapper::sendProgress = 0; | 18 | progressMailSend*SMTPwrapper::sendProgress = 0; |
18 | 19 | ||
19 | SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) | 20 | SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) |
20 | : Generatemail() | 21 | : Generatemail() |
21 | { | 22 | { |
22 | m_SmtpAccount = aSmtp; | 23 | m_SmtpAccount = aSmtp; |
23 | Config cfg( "mail" ); | 24 | Config cfg( "mail" ); |
24 | cfg.setGroup( "Status" ); | 25 | cfg.setGroup( "Status" ); |
25 | m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); | 26 | m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); |
26 | emit queuedMails( m_queuedMail ); | 27 | emit queuedMails( m_queuedMail ); |
27 | connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); | 28 | connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); |
28 | m_smtp = 0; | 29 | m_smtp = 0; |
29 | } | 30 | } |
30 | 31 | ||
31 | SMTPwrapper::~SMTPwrapper() | 32 | SMTPwrapper::~SMTPwrapper() |
32 | { | 33 | { |
33 | disc_server(); | 34 | disc_server(); |
34 | } | 35 | } |
35 | 36 | ||
36 | void SMTPwrapper::emitQCop( int queued ) { | 37 | void SMTPwrapper::emitQCop( int queued ) { |
37 | QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); | 38 | QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); |
38 | env << queued; | 39 | env << queued; |
39 | } | 40 | } |
40 | 41 | ||
41 | QString SMTPwrapper::mailsmtpError( int errnum ) { | 42 | QString SMTPwrapper::mailsmtpError( int errnum ) { |
42 | switch ( errnum ) { | 43 | switch ( errnum ) { |
43 | case MAILSMTP_NO_ERROR: | 44 | case MAILSMTP_NO_ERROR: |
44 | return tr( "No error" ); | 45 | return tr( "No error" ); |
45 | case MAILSMTP_ERROR_UNEXPECTED_CODE: | 46 | case MAILSMTP_ERROR_UNEXPECTED_CODE: |
46 | return tr( "Unexpected error code" ); | 47 | return tr( "Unexpected error code" ); |
47 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: | 48 | case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: |
48 | return tr( "Service not available" ); | 49 | return tr( "Service not available" ); |
49 | case MAILSMTP_ERROR_STREAM: | 50 | case MAILSMTP_ERROR_STREAM: |
50 | return tr( "Stream error" ); | 51 | return tr( "Stream error" ); |
51 | case MAILSMTP_ERROR_HOSTNAME: | 52 | case MAILSMTP_ERROR_HOSTNAME: |
52 | return tr( "gethostname() failed" ); | 53 | return tr( "gethostname() failed" ); |
53 | case MAILSMTP_ERROR_NOT_IMPLEMENTED: | 54 | case MAILSMTP_ERROR_NOT_IMPLEMENTED: |
54 | return tr( "Not implemented" ); | 55 | return tr( "Not implemented" ); |
55 | case MAILSMTP_ERROR_ACTION_NOT_TAKEN: | 56 | case MAILSMTP_ERROR_ACTION_NOT_TAKEN: |
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp index 51383f6..7e14df3 100644 --- a/noncore/net/mail/libmailwrapper/statusmail.cpp +++ b/noncore/net/mail/libmailwrapper/statusmail.cpp | |||
@@ -1,50 +1,54 @@ | |||
1 | #include "statusmail.h" | 1 | #include "statusmail.h" |
2 | 2 | ||
3 | #include <opie2/odebug.h> | ||
4 | |||
5 | using namespace Opie::Core; | ||
6 | |||
3 | StatusMail::StatusMail(QList<Account>&list) | 7 | StatusMail::StatusMail(QList<Account>&list) |
4 | { | 8 | { |
5 | currentImapStat.message_count=0; | 9 | currentImapStat.message_count=0; |
6 | currentImapStat.message_unseen=0; | 10 | currentImapStat.message_unseen=0; |
7 | currentImapStat.message_recent=0; | 11 | currentImapStat.message_recent=0; |
8 | lastPop3Stat = currentImapStat; | 12 | lastPop3Stat = currentImapStat; |
9 | currentPop3Stat = currentImapStat; | 13 | currentPop3Stat = currentImapStat; |
10 | connectionList.setAutoDelete(true); | 14 | connectionList.setAutoDelete(true); |
11 | connectionList.clear(); | 15 | connectionList.clear(); |
12 | initAccounts(list); | 16 | initAccounts(list); |
13 | } | 17 | } |
14 | 18 | ||
15 | StatusMail::~StatusMail() | 19 | StatusMail::~StatusMail() |
16 | { | 20 | { |
17 | } | 21 | } |
18 | 22 | ||
19 | void StatusMail::initAccounts(QList<Account>&accounts) | 23 | void StatusMail::initAccounts(QList<Account>&accounts) |
20 | { | 24 | { |
21 | 25 | ||
22 | Account *it; | 26 | Account *it; |
23 | folderStat currentStat; | 27 | folderStat currentStat; |
24 | AbstractMail * current = 0; | 28 | AbstractMail * current = 0; |
25 | currentPop3Stat.message_count=0; | 29 | currentPop3Stat.message_count=0; |
26 | currentPop3Stat.message_recent=0; | 30 | currentPop3Stat.message_recent=0; |
27 | currentPop3Stat.message_unseen=0; | 31 | currentPop3Stat.message_unseen=0; |
28 | for ( it = accounts.first(); it; it = accounts.next() ) { | 32 | for ( it = accounts.first(); it; it = accounts.next() ) { |
29 | if ( it->getType()==MAILLIB::A_IMAP && !it->getOffline() ) { | 33 | if ( it->getType()==MAILLIB::A_IMAP && !it->getOffline() ) { |
30 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); | 34 | IMAPaccount*ima = static_cast<IMAPaccount *>(it); |
31 | current = AbstractMail::getWrapper(ima); | 35 | current = AbstractMail::getWrapper(ima); |
32 | connectionList.append(current); | 36 | connectionList.append(current); |
33 | current->statusFolder(currentStat); | 37 | current->statusFolder(currentStat); |
34 | currentImapStat.message_count+=currentStat.message_unseen; | 38 | currentImapStat.message_count+=currentStat.message_unseen; |
35 | currentImapStat.message_count+=currentStat.message_recent; | 39 | currentImapStat.message_count+=currentStat.message_recent; |
36 | currentImapStat.message_count+=currentStat.message_count; | 40 | currentImapStat.message_count+=currentStat.message_count; |
37 | } else if ( it->getType() == MAILLIB::A_POP3 && !it->getOffline() ) { | 41 | } else if ( it->getType() == MAILLIB::A_POP3 && !it->getOffline() ) { |
38 | POP3account *pop3 = static_cast<POP3account *>(it); | 42 | POP3account *pop3 = static_cast<POP3account *>(it); |
39 | current = AbstractMail::getWrapper(pop3); | 43 | current = AbstractMail::getWrapper(pop3); |
40 | connectionList.append(current); | 44 | connectionList.append(current); |
41 | current->statusFolder(currentStat); | 45 | current->statusFolder(currentStat); |
42 | currentPop3Stat.message_count+=currentStat.message_count; | 46 | currentPop3Stat.message_count+=currentStat.message_count; |
43 | } | 47 | } |
44 | current->logout(); | 48 | current->logout(); |
45 | } | 49 | } |
46 | odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl; | 50 | odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl; |
47 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; | 51 | currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; |
48 | lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; | 52 | lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; |
49 | lastPop3Stat.message_recent = currentPop3Stat.message_recent; | 53 | lastPop3Stat.message_recent = currentPop3Stat.message_recent; |
50 | lastPop3Stat.message_count = currentPop3Stat.message_count; | 54 | lastPop3Stat.message_count = currentPop3Stat.message_count; |
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp index 546d756..4add8a1 100644 --- a/noncore/net/mail/libmailwrapper/storemail.cpp +++ b/noncore/net/mail/libmailwrapper/storemail.cpp | |||
@@ -1,55 +1,55 @@ | |||
1 | #include "storemail.h" | 1 | #include "storemail.h" |
2 | #include "mailwrapper.h" | 2 | #include "mailwrapper.h" |
3 | #include "settings.h" | 3 | #include "settings.h" |
4 | #include "abstractmail.h" | 4 | #include "abstractmail.h" |
5 | 5 | ||
6 | #include <libetpan/libetpan.h> | 6 | #include <libetpan/libetpan.h> |
7 | 7 | #include <opie2/odebug.h> | |
8 | #include <qstring.h> | 8 | #include <qstring.h> |
9 | 9 | ||
10 | #include <stdlib.h> | 10 | #include <stdlib.h> |
11 | 11 | ||
12 | using namespace Opie::Core; | 12 | using namespace Opie::Core; |
13 | Storemail::Storemail(Account*aAccount,const QString&aFolder) | 13 | Storemail::Storemail(Account*aAccount,const QString&aFolder) |
14 | : Generatemail() | 14 | : Generatemail() |
15 | { | 15 | { |
16 | wrapper = 0; | 16 | wrapper = 0; |
17 | m_Account = aAccount; | 17 | m_Account = aAccount; |
18 | m_tfolder = aFolder; | 18 | m_tfolder = aFolder; |
19 | wrapper = AbstractMail::getWrapper(m_Account); | 19 | wrapper = AbstractMail::getWrapper(m_Account); |
20 | if (wrapper) { | 20 | if (wrapper) { |
21 | wrapper->createMbox(m_tfolder); | 21 | wrapper->createMbox(m_tfolder); |
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | Storemail::Storemail(const QString&dir,const QString&aFolder) | 25 | Storemail::Storemail(const QString&dir,const QString&aFolder) |
26 | : Generatemail() | 26 | : Generatemail() |
27 | { | 27 | { |
28 | wrapper = 0; | 28 | wrapper = 0; |
29 | m_Account = 0; | 29 | m_Account = 0; |
30 | m_tfolder = aFolder; | 30 | m_tfolder = aFolder; |
31 | wrapper = AbstractMail::getWrapper(dir); | 31 | wrapper = AbstractMail::getWrapper(dir); |
32 | if (wrapper) { | 32 | if (wrapper) { |
33 | wrapper->createMbox(m_tfolder); | 33 | wrapper->createMbox(m_tfolder); |
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
37 | Storemail::Storemail(const QString&aFolder) | 37 | Storemail::Storemail(const QString&aFolder) |
38 | : Generatemail() | 38 | : Generatemail() |
39 | { | 39 | { |
40 | wrapper = 0; | 40 | wrapper = 0; |
41 | m_Account = 0; | 41 | m_Account = 0; |
42 | m_tfolder = aFolder; | 42 | m_tfolder = aFolder; |
43 | wrapper = AbstractMail::getWrapper(AbstractMail::defaultLocalfolder()); | 43 | wrapper = AbstractMail::getWrapper(AbstractMail::defaultLocalfolder()); |
44 | if (wrapper) { | 44 | if (wrapper) { |
45 | wrapper->createMbox(m_tfolder); | 45 | wrapper->createMbox(m_tfolder); |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | Storemail::~Storemail() | 49 | Storemail::~Storemail() |
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) | 53 | int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail) |
54 | { | 54 | { |
55 | if (!wrapper) return 0; | 55 | if (!wrapper) return 0; |