author | harlekin <harlekin> | 2004-02-29 21:55:06 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-02-29 21:55:06 (UTC) |
commit | dcf152e23f7cc85fe2e46521e07b64e2288efdda (patch) (unidiff) | |
tree | 8aac8095aed8dc9a9efab7005b8f1c53cce82536 /noncore/net/mail/libmailwrapper/abstractmail.cpp | |
parent | 225b92ec28bbe3a9368e8534323a3c335432e447 (diff) | |
download | opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.zip opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.tar.gz opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.tar.bz2 |
beginning of nntp stuff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/abstractmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 592cd5e..741a8e1 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -1,9 +1,10 @@ | |||
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 "mhwrapper.h" | 5 | #include "mhwrapper.h" |
5 | #include "mboxwrapper.h" | 6 | #include "mboxwrapper.h" |
6 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
7 | 8 | ||
8 | #include <qstring.h> | 9 | #include <qstring.h> |
9 | #include <qfile.h> | 10 | #include <qfile.h> |
@@ -19,12 +20,17 @@ AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) | |||
19 | 20 | ||
20 | AbstractMail* AbstractMail::getWrapper(POP3account *a) | 21 | AbstractMail* AbstractMail::getWrapper(POP3account *a) |
21 | { | 22 | { |
22 | return new POP3wrapper(a); | 23 | return new POP3wrapper(a); |
23 | } | 24 | } |
24 | 25 | ||
26 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) | ||
27 | { | ||
28 | return new NNTPwrapper(a); | ||
29 | } | ||
30 | |||
25 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) | 31 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) |
26 | { | 32 | { |
27 | return new MHwrapper(a,name); | 33 | return new MHwrapper(a,name); |
28 | } | 34 | } |
29 | 35 | ||
30 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) | 36 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
@@ -45,26 +51,26 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
45 | } else if (enc.lower()=="binary") { | 51 | } else if (enc.lower()=="binary") { |
46 | mimetype = MAILMIME_MECHANISM_BINARY; | 52 | mimetype = MAILMIME_MECHANISM_BINARY; |
47 | } | 53 | } |
48 | 54 | ||
49 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, | 55 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, |
50 | &result_text,&target_length); | 56 | &result_text,&target_length); |
51 | 57 | ||
52 | encodedString* result = new encodedString(); | 58 | encodedString* result = new encodedString(); |
53 | if (err == MAILIMF_NO_ERROR) { | 59 | if (err == MAILIMF_NO_ERROR) { |
54 | result->setContent(result_text,target_length); | 60 | result->setContent(result_text,target_length); |
55 | } | 61 | } |
56 | qDebug("Decode string finished"); | 62 | qDebug("Decode string finished"); |
57 | return result; | 63 | return result; |
58 | } | 64 | } |
59 | 65 | ||
60 | QString AbstractMail::convert_String(const char*text) | 66 | QString AbstractMail::convert_String(const char*text) |
61 | { | 67 | { |
62 | size_t index = 0; | 68 | size_t index = 0; |
63 | char*res = 0; | 69 | char*res = 0; |
64 | 70 | ||
65 | /* attention - doesn't work with arm systems! */ | 71 | /* attention - doesn't work with arm systems! */ |
66 | int err = mailmime_encoded_phrase_parse("iso-8859-1", | 72 | int err = mailmime_encoded_phrase_parse("iso-8859-1", |
67 | text, strlen(text),&index, "iso-8859-1",&res); | 73 | text, strlen(text),&index, "iso-8859-1",&res); |
68 | if (err != MAILIMF_NO_ERROR) { | 74 | if (err != MAILIMF_NO_ERROR) { |
69 | if (res) free(res); | 75 | if (res) free(res); |
70 | return QString(text); | 76 | return QString(text); |