Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 2 |
7 files changed, 23 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index a070fb0..7c060db 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -46,12 +46,14 @@ public: | |||
46 | static AbstractMail* getWrapper(POP3account *a); | 46 | static AbstractMail* getWrapper(POP3account *a); |
47 | /* mbox only! */ | 47 | /* mbox only! */ |
48 | static AbstractMail* getWrapper(const QString&a); | 48 | static AbstractMail* getWrapper(const QString&a); |
49 | 49 | ||
50 | static QString defaultLocalfolder(); | 50 | static QString defaultLocalfolder(); |
51 | 51 | ||
52 | virtual const QString&getType()const=0; | ||
53 | |||
52 | protected: | 54 | protected: |
53 | static encodedString*decode_String(const encodedString*text,const QString&enc); | 55 | static encodedString*decode_String(const encodedString*text,const QString&enc); |
54 | static QString convert_String(const char*text); | 56 | static QString convert_String(const char*text); |
55 | static QString gen_attachment_id(); | 57 | static QString gen_attachment_id(); |
56 | }; | 58 | }; |
57 | #endif | 59 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 0c1e05e..95b317a 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -982,6 +982,11 @@ void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folde | |||
982 | if (!msg) return; | 982 | if (!msg) return; |
983 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); | 983 | int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length); |
984 | if (r != MAILIMAP_NO_ERROR) { | 984 | if (r != MAILIMAP_NO_ERROR) { |
985 | Global::statusMessage("Error storing mail!"); | 985 | Global::statusMessage("Error storing mail!"); |
986 | } | 986 | } |
987 | } | 987 | } |
988 | |||
989 | const QString&IMAPwrapper::getType()const | ||
990 | { | ||
991 | return account->getType(); | ||
992 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h index a97f12d..6a9c411 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.h +++ b/noncore/net/mail/libmailwrapper/imapwrapper.h | |||
@@ -40,12 +40,13 @@ public: | |||
40 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 40 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
41 | virtual int deleteMbox(const Folder*folder); | 41 | virtual int deleteMbox(const Folder*folder); |
42 | 42 | ||
43 | static void imap_progress( size_t current, size_t maximum ); | 43 | static void imap_progress( size_t current, size_t maximum ); |
44 | 44 | ||
45 | virtual void logout(); | 45 | virtual void logout(); |
46 | virtual const QString&getType()const; | ||
46 | protected: | 47 | protected: |
47 | RecMail*parse_list_result(mailimap_msg_att*); | 48 | RecMail*parse_list_result(mailimap_msg_att*); |
48 | void login(); | 49 | void login(); |
49 | 50 | ||
50 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); | 51 | virtual QString fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); |
51 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); | 52 | virtual encodedString*fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call); |
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 540a971..60f7507 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |||
@@ -3,12 +3,14 @@ | |||
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"; | ||
10 | |||
9 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) | 11 | MBOXwrapper::MBOXwrapper(const QString & mbox_dir) |
10 | : Genericwrapper(),MBOXPath(mbox_dir) | 12 | : Genericwrapper(),MBOXPath(mbox_dir) |
11 | { | 13 | { |
12 | QDir dir(MBOXPath); | 14 | QDir dir(MBOXPath); |
13 | if (!dir.exists()) { | 15 | if (!dir.exists()) { |
14 | dir.mkdir(MBOXPath); | 16 | dir.mkdir(MBOXPath); |
@@ -319,6 +321,11 @@ void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
319 | r = mailfolder_connect(folder); | 321 | r = mailfolder_connect(folder); |
320 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, | 322 | r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, |
321 | &target_stat.message_recent,&target_stat.message_unseen); | 323 | &target_stat.message_recent,&target_stat.message_unseen); |
322 | if (folder) mailfolder_free(folder); | 324 | if (folder) mailfolder_free(folder); |
323 | if (storage) mailstorage_free(storage); | 325 | if (storage) mailstorage_free(storage); |
324 | } | 326 | } |
327 | |||
328 | const QString&MBOXwrapper::getType()const | ||
329 | { | ||
330 | return wrapperType; | ||
331 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index f822997..f97fce2 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h | |||
@@ -30,13 +30,15 @@ public: | |||
30 | virtual RecBody fetchBody( const RecMail &mail ); | 30 | virtual RecBody fetchBody( const RecMail &mail ); |
31 | static void mbox_progress( size_t current, size_t maximum ); | 31 | static void mbox_progress( size_t current, size_t maximum ); |
32 | 32 | ||
33 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); | 33 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); |
34 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); | 34 | virtual void deleteMails(const QString & mailbox,QList<RecMail> &target); |
35 | virtual int deleteAllMail(const Folder*); | 35 | virtual int deleteAllMail(const Folder*); |
36 | virtual const QString&getType()const; | ||
36 | 37 | ||
37 | protected: | 38 | protected: |
38 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); | 39 | static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); |
39 | QString MBOXPath; | 40 | QString MBOXPath; |
41 | static const QString wrapperType; | ||
40 | }; | 42 | }; |
41 | 43 | ||
42 | #endif | 44 | #endif |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index b4eca6f..45408dd 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -232,6 +232,11 @@ void POP3wrapper::fetchRawBody(const RecMail&mail,char**target,size_t*length) | |||
232 | { | 232 | { |
233 | mailmessage * mailmsg = 0; | 233 | mailmessage * mailmsg = 0; |
234 | int err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); | 234 | int err = mailsession_get_message(m_folder->fld_session, mail.getNumber(), &mailmsg); |
235 | err = mailmessage_fetch(mailmsg,target,length); | 235 | err = mailmessage_fetch(mailmsg,target,length); |
236 | if (mailmsg) mailmessage_free(mailmsg); | 236 | if (mailmsg) mailmessage_free(mailmsg); |
237 | } | 237 | } |
238 | |||
239 | const QString&POP3wrapper::getType()const | ||
240 | { | ||
241 | return account->getType(); | ||
242 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index 9cba101..b7e8f27 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h | |||
@@ -25,13 +25,13 @@ public: | |||
25 | virtual void answeredMail(const RecMail&mail); | 25 | virtual void answeredMail(const RecMail&mail); |
26 | virtual int deleteAllMail(const Folder*); | 26 | virtual int deleteAllMail(const Folder*); |
27 | 27 | ||
28 | virtual RecBody fetchBody( const RecMail &mail ); | 28 | virtual RecBody fetchBody( const RecMail &mail ); |
29 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); | 29 | virtual void fetchRawBody(const RecMail&mail,char**target,size_t*length); |
30 | virtual void logout(); | 30 | virtual void logout(); |
31 | 31 | virtual const QString&getType()const; | |
32 | static void pop3_progress( size_t current, size_t maximum ); | 32 | static void pop3_progress( size_t current, size_t maximum ); |
33 | 33 | ||
34 | protected: | 34 | protected: |
35 | void login(); | 35 | void login(); |
36 | POP3account *account; | 36 | POP3account *account; |
37 | mailstorage*m_pop3; | 37 | mailstorage*m_pop3; |