summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
authoralwin <alwin>2003-12-28 02:45:07 (UTC)
committer alwin <alwin>2003-12-28 02:45:07 (UTC)
commitd1a7eb08cad465c5fc0de53f75aaecf7803f0945 (patch) (unidiff)
tree422b73af760cdd44e4fbbc96bd6876a15939ff19 /noncore/net/mail/libmailwrapper/pop3wrapper.cpp
parente889485e945d8fa9564566f286114be10d2a1ce5 (diff)
downloadopie-d1a7eb08cad465c5fc0de53f75aaecf7803f0945.zip
opie-d1a7eb08cad465c5fc0de53f75aaecf7803f0945.tar.gz
opie-d1a7eb08cad465c5fc0de53f75aaecf7803f0945.tar.bz2
- dir handling for mbox accounts (delete, new, delete all mail)
- fixed memory leaks in mbox account class - reduced count of used string constants while using "tr" with context string - mbox displays messages into global status bar - fixed a possible raise condition when deleting a mail directory
Diffstat (limited to 'noncore/net/mail/libmailwrapper/pop3wrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index efd83ba..b85fbf6 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -1,13 +1,12 @@
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/mailpop3.h> 5#include <libetpan/libetpan.h>
6#include <libetpan/mailmime.h> 6#include <qpe/global.h>
7#include <libetpan/data_message_driver.h>
8#include <qfile.h> 7#include <qfile.h>
9 8
10/* we don't fetch messages larger than 5 MB */ 9/* we don't fetch messages larger than 5 MB */
11#define HARD_MSG_SIZE_LIMIT 5242880 10#define HARD_MSG_SIZE_LIMIT 5242880
12 11
13POP3wrapper::POP3wrapper( POP3account *a ) 12POP3wrapper::POP3wrapper( POP3account *a )
@@ -109,12 +108,13 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target )
109 /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */ 108 /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */
110 size_t length = 0; 109 size_t length = 0;
111 carray * messages = 0; 110 carray * messages = 0;
112 111
113 login(); 112 login();
114 if (!m_pop3) return; 113 if (!m_pop3) return;
114
115 mailpop3_list( m_pop3, &messages ); 115 mailpop3_list( m_pop3, &messages );
116 116
117 for (unsigned int i = 0; i < carray_count(messages);++i) { 117 for (unsigned int i = 0; i < carray_count(messages);++i) {
118 mailpop3_msg_info *info; 118 mailpop3_msg_info *info;
119 err = mailpop3_get_msg_info(m_pop3,i+1,&info); 119 err = mailpop3_get_msg_info(m_pop3,i+1,&info);
120 if (info->msg_deleted) 120 if (info->msg_deleted)
@@ -129,12 +129,13 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target )
129 mail->setNumber( info->msg_index ); 129 mail->setNumber( info->msg_index );
130 mail->setWrapper(this); 130 mail->setWrapper(this);
131 mail->setMsgsize(info->msg_size); 131 mail->setMsgsize(info->msg_size);
132 target.append( mail ); 132 target.append( mail );
133 free(header); 133 free(header);
134 } 134 }
135 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(carray_count(messages)-m_pop3->pop3_deleted_count));
135} 136}
136 137
137void POP3wrapper::login() 138void POP3wrapper::login()
138{ 139{
139 /* we'll hold the line */ 140 /* we'll hold the line */
140 if ( m_pop3 != NULL ) return; 141 if ( m_pop3 != NULL ) return;