Diffstat (limited to 'noncore/net/mail/abstractmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/abstractmail.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/noncore/net/mail/abstractmail.cpp b/noncore/net/mail/abstractmail.cpp index 0bb2525..92a46f1 100644 --- a/noncore/net/mail/abstractmail.cpp +++ b/noncore/net/mail/abstractmail.cpp | |||
@@ -3,2 +3,3 @@ | |||
3 | #include "pop3wrapper.h" | 3 | #include "pop3wrapper.h" |
4 | #include "mailtypes.h" | ||
4 | 5 | ||
@@ -18,7 +19,7 @@ AbstractMail* AbstractMail::getWrapper(POP3account *a) | |||
18 | 19 | ||
19 | QString AbstractMail::decode_quoted_printable(const char*text) | 20 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
20 | { | 21 | { |
22 | qDebug("Decode string start"); | ||
21 | char*result_text; | 23 | char*result_text; |
22 | size_t index = 0; | 24 | size_t index = 0; |
23 | QString result = ""; | ||
24 | /* reset for recursive use! */ | 25 | /* reset for recursive use! */ |
@@ -26,8 +27,21 @@ QString AbstractMail::decode_quoted_printable(const char*text) | |||
26 | result_text = 0; | 27 | result_text = 0; |
27 | int err = mailmime_quoted_printable_body_parse(text,strlen(text), | 28 | int mimetype = MAILMIME_MECHANISM_7BIT; |
28 | &index,&result_text,&target_length,0); | 29 | if (enc.lower()=="quoted-printable") { |
29 | if (result_text) { | 30 | mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; |
30 | result = result_text; | 31 | } else if (enc.lower()=="base64") { |
31 | free(result_text); | 32 | mimetype = MAILMIME_MECHANISM_BASE64; |
33 | } else if (enc.lower()=="8bit") { | ||
34 | mimetype = MAILMIME_MECHANISM_8BIT; | ||
35 | } else if (enc.lower()=="binary") { | ||
36 | mimetype = MAILMIME_MECHANISM_BINARY; | ||
32 | } | 37 | } |
38 | |||
39 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, | ||
40 | &result_text,&target_length); | ||
41 | |||
42 | encodedString* result = new encodedString(); | ||
43 | if (err == MAILIMF_NO_ERROR) { | ||
44 | result->setContent(result_text,target_length); | ||
45 | } | ||
46 | qDebug("Decode string finished"); | ||
33 | return result; | 47 | return result; |