diff options
-rw-r--r-- | framework/domain/mimetreeparser/interface.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/framework/domain/mimetreeparser/interface.cpp b/framework/domain/mimetreeparser/interface.cpp index 283ced9b..6184ae82 100644 --- a/framework/domain/mimetreeparser/interface.cpp +++ b/framework/domain/mimetreeparser/interface.cpp | |||
@@ -626,7 +626,7 @@ QByteArray Content::charset() const | |||
626 | 626 | ||
627 | QString Content::encodedContent() const | 627 | QString Content::encodedContent() const |
628 | { | 628 | { |
629 | return encodedContent(charset()); | 629 | return QString::fromUtf8(content()); |
630 | } | 630 | } |
631 | 631 | ||
632 | QString Content::encodedContent(const QByteArray &charset) const | 632 | QString Content::encodedContent(const QByteArray &charset) const |
@@ -775,7 +775,7 @@ void SinglePartPrivate::fillFrom(MimeTreeParser::TextMessagePart::Ptr part) | |||
775 | mContent.clear(); | 775 | mContent.clear(); |
776 | foreach (const auto &mp, part->subParts()) { | 776 | foreach (const auto &mp, part->subParts()) { |
777 | auto d_ptr = new ContentPrivate; | 777 | auto d_ptr = new ContentPrivate; |
778 | d_ptr->mContent = mp->text().toLocal8Bit(); | 778 | d_ptr->mContent = mp->text().toUtf8(); |
779 | d_ptr->mParent = q; | 779 | d_ptr->mParent = q; |
780 | const auto enc = mp.dynamicCast<MimeTreeParser::EncryptedMessagePart>(); | 780 | const auto enc = mp.dynamicCast<MimeTreeParser::EncryptedMessagePart>(); |
781 | auto sig = mp.dynamicCast<MimeTreeParser::SignedMessagePart>(); | 781 | auto sig = mp.dynamicCast<MimeTreeParser::SignedMessagePart>(); |
@@ -799,7 +799,7 @@ void SinglePartPrivate::fillFrom(MimeTreeParser::HtmlMessagePart::Ptr part) | |||
799 | { | 799 | { |
800 | mType = "html"; | 800 | mType = "html"; |
801 | mContent.clear(); | 801 | mContent.clear(); |
802 | mContent.append(std::make_shared<HtmlContent>(part->text().toLocal8Bit(), q)); | 802 | mContent.append(std::make_shared<HtmlContent>(part->text().toUtf8(), q)); |
803 | q->reachParentD()->createMailMime(part); | 803 | q->reachParentD()->createMailMime(part); |
804 | } | 804 | } |
805 | 805 | ||
@@ -809,13 +809,15 @@ void SinglePartPrivate::fillFrom(MimeTreeParser::AttachmentMessagePart::Ptr part | |||
809 | q->reachParentD()->createMailMime(part.staticCast<MimeTreeParser::TextMessagePart>()); | 809 | q->reachParentD()->createMailMime(part.staticCast<MimeTreeParser::TextMessagePart>()); |
810 | const auto mimetype = q->mailMime()->mimetype(); | 810 | const auto mimetype = q->mailMime()->mimetype(); |
811 | const auto content = q->mailMime()->decodedContent(); | 811 | const auto content = q->mailMime()->decodedContent(); |
812 | mType = mimetype.name().toUtf8(); | ||
813 | mContent.clear(); | 812 | mContent.clear(); |
814 | if (mimetype == mimeDb.mimeTypeForName("text/plain")) { | 813 | if (mimetype == mimeDb.mimeTypeForName("text/plain")) { |
814 | mType = "plaintext"; | ||
815 | mContent.append(std::make_shared<PlainTextContent>(content, q)); | 815 | mContent.append(std::make_shared<PlainTextContent>(content, q)); |
816 | } else if (mimetype == mimeDb.mimeTypeForName("text/html")) { | 816 | } else if (mimetype == mimeDb.mimeTypeForName("text/html")) { |
817 | mType = "html"; | ||
817 | mContent.append(std::make_shared<HtmlContent>(content, q)); | 818 | mContent.append(std::make_shared<HtmlContent>(content, q)); |
818 | } else { | 819 | } else { |
820 | mType = mimetype.name().toUtf8(); | ||
819 | mContent.append(std::make_shared<Content>(content, q)); | 821 | mContent.append(std::make_shared<Content>(content, q)); |
820 | } | 822 | } |
821 | } | 823 | } |