author | zautrix <zautrix> | 2004-11-06 23:30:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-06 23:30:02 (UTC) |
commit | 023e0e82dd8bf6421d12492a2dd25534fc43ad31 (patch) (unidiff) | |
tree | cf0533e3ccc642cb57a41953f184f457fa5365ba /kmicromail/libmailwrapper | |
parent | f8841c92d5251f713eb7a025af8fdee52de45b3d (diff) | |
download | kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.zip kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.gz kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.bz2 |
many ompi fixes
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 9 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 16 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 19 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mboxwrapper.cpp | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 1 |
5 files changed, 41 insertions, 5 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 8ee112c..ed5c898 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -77,5 +77,4 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
77 | mimetype = MAILMIME_MECHANISM_BINARY; | 77 | mimetype = MAILMIME_MECHANISM_BINARY; |
78 | } | 78 | } |
79 | |||
80 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, | 79 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, |
81 | &result_text,&target_length); | 80 | &result_text,&target_length); |
@@ -96,9 +95,11 @@ QString AbstractMail::convert_String(const char*text) | |||
96 | 95 | ||
97 | QString result(text); | 96 | QString result(text); |
98 | 97 | //qDebug("convert_String %s ", text); | |
98 | //err = mailmime_encoded_phrase_parse("iso-8859-1", | ||
99 | // text, strlen(text),&index, "iso-8859-1",&res); | ||
99 | err = mailmime_encoded_phrase_parse("iso-8859-1", | 100 | err = mailmime_encoded_phrase_parse("iso-8859-1", |
100 | text, strlen(text),&index, "iso-8859-1",&res); | 101 | text, strlen(text),&index, "utf-8",&res); |
101 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { | 102 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { |
102 | result = QString(res); | 103 | result = QString::fromUtf8(res); |
103 | } | 104 | } |
104 | //qDebug("convert_String:%s ",result.latin1() ); | 105 | //qDebug("convert_String:%s ",result.latin1() ); |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index d89a5f9..49227dd 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -221,4 +221,18 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m | |||
221 | b = QString(res->Content()); | 221 | b = QString(res->Content()); |
222 | delete res; | 222 | delete res; |
223 | size_t index = 0; | ||
224 | char*resu = 0; | ||
225 | int err = MAILIMF_NO_ERROR; | ||
226 | QString charset = part->searchParamter( "charset"); | ||
227 | qDebug("CHARSET %s ",charset.latin1() ); | ||
228 | if ( !charset.isEmpty() ) { | ||
229 | err = mailmime_encoded_phrase_parse(charset.latin1(), | ||
230 | b.latin1(), b.length(),&index, "utf-8",&resu); | ||
231 | if (err == MAILIMF_NO_ERROR && resu && strlen(resu)) { | ||
232 | //qDebug("res %d %s ", index, resu); | ||
233 | b = QString::fromUtf8(resu); | ||
234 | } | ||
235 | if (resu) free(resu); | ||
236 | } | ||
223 | target->setBodytext(b); | 237 | target->setBodytext(b); |
224 | target->setDescription(part); | 238 | target->setDescription(part); |
@@ -345,5 +359,5 @@ QString Genericwrapper::parseMailbox( mailimf_mailbox *box ) | |||
345 | result.append( box->mb_addr_spec ); | 359 | result.append( box->mb_addr_spec ); |
346 | } else { | 360 | } else { |
347 | result.append( convert_String(box->mb_display_name).latin1() ); | 361 | result.append( convert_String(box->mb_display_name) ); |
348 | result.append( " <" ); | 362 | result.append( " <" ); |
349 | result.append( box->mb_addr_spec ); | 363 | result.append( box->mb_addr_spec ); |
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index d90a8d2..eb2b47d 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -753,4 +753,23 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t | |||
753 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { | 753 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { |
754 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); | 754 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); |
755 | |||
756 | size_t index = 0; | ||
757 | char*res = 0; | ||
758 | int err = MAILIMF_NO_ERROR; | ||
759 | |||
760 | QString charset = currentPart->searchParamter( "charset"); | ||
761 | qDebug("CHARSET %s ",charset.latin1() ); | ||
762 | //if ( false ) { | ||
763 | if ( !charset.isEmpty() ) { | ||
764 | //err = mailmime_encoded_phrase_parse("iso-8859-1", | ||
765 | // text, strlen(text),&index, "iso-8859-1",&res); | ||
766 | err = mailmime_encoded_phrase_parse(charset.latin1(), | ||
767 | body_text.latin1(), body_text.length(),&index, "utf-8",&res); | ||
768 | if (err == MAILIMF_NO_ERROR && res && strlen(res)) { | ||
769 | //qDebug("res %d %s ", index, res); | ||
770 | body_text = QString::fromUtf8(res); | ||
771 | } | ||
772 | if (res) free(res); | ||
773 | } | ||
755 | //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() ); | 774 | //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() ); |
756 | target_body->setDescription(currentPart); | 775 | target_body->setDescription(currentPart); |
diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp index 0cdbae4..87f8c8a 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.cpp +++ b/kmicromail/libmailwrapper/mboxwrapper.cpp | |||
@@ -126,4 +126,5 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail ) | |||
126 | return body; | 126 | return body; |
127 | } | 127 | } |
128 | qDebug("MBOXwrapper::fetchBody "); | ||
128 | body = parseMail(msg); | 129 | body = parseMail(msg); |
129 | mailmessage_fetch_result_free(msg,data); | 130 | mailmessage_fetch_result_free(msg,data); |
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 90b5d23..982d7a6 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp | |||
@@ -129,4 +129,5 @@ void MHwrapper::answeredMail(const RecMailP&) | |||
129 | RecBodyP MHwrapper::fetchBody( const RecMailP &mail ) | 129 | RecBodyP MHwrapper::fetchBody( const RecMailP &mail ) |
130 | { | 130 | { |
131 | qDebug("MHwrapper::fetchBody "); | ||
131 | RecBodyP body = new RecBody(); | 132 | RecBodyP body = new RecBody(); |
132 | init_storage(); | 133 | init_storage(); |