From 1071beb43d7c068cf1a4bd1d4f118ae1e825edb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C5=91k=C3=A9s=20Attila?= Date: Thu, 9 Aug 2012 22:17:07 +0300 Subject: [PATCH] Bug corrected in MimeMultiPart. Getter and setter for content in MimeMessage. --- src/mimemessage.cpp | 8 +++++++- src/mimemessage.h | 2 ++ src/mimemultipart.cpp | 2 +- src/mimemultipart.h | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mimemessage.cpp b/src/mimemessage.cpp index dacec92..211fdc6 100644 --- a/src/mimemessage.cpp +++ b/src/mimemessage.cpp @@ -33,13 +33,19 @@ MimeMessage::MimeMessage(bool createAutoMimeContent) : MimeMessage::~MimeMessage() { - } /* [1] --- */ /* [2] Getters and Setters */ +MimePart& MimeMessage::getContent() { + return *content; +} + +void MimeMessage::setContent(MimePart *content) { + this->content = content; +} void MimeMessage::setSender(EmailAddress* e) { diff --git a/src/mimemessage.h b/src/mimemessage.h index db596dd..d0297d1 100644 --- a/src/mimemessage.h +++ b/src/mimemessage.h @@ -59,6 +59,8 @@ public: const QString & getSubject() const; const QList & getParts() const; + MimePart& getContent(); + void setContent(MimePart *content); /* [2] --- */ diff --git a/src/mimemultipart.cpp b/src/mimemultipart.cpp index c7d1dbd..19d4729 100644 --- a/src/mimemultipart.cpp +++ b/src/mimemultipart.cpp @@ -36,7 +36,6 @@ MimeMultiPart::MimeMultiPart(MultiPartType type) this->cType = MULTI_PART_NAMES[this->type]; this->cEncoding = _8Bit; - qsrand(QTime::currentTime().msec()); QCryptographicHash md5(QCryptographicHash::Md5); md5.addData(QByteArray().append(qrand())); cBoundary = md5.result().toHex(); @@ -71,6 +70,7 @@ void MimeMultiPart::prepare() { void MimeMultiPart::setMimeType(const MultiPartType type) { this->type = type; + this->cType = MULTI_PART_NAMES[type]; } MimeMultiPart::MultiPartType MimeMultiPart::getMimeType() const { diff --git a/src/mimemultipart.h b/src/mimemultipart.h index 256af2c..8a85b6f 100644 --- a/src/mimemultipart.h +++ b/src/mimemultipart.h @@ -67,7 +67,6 @@ protected: QList< MimePart* > parts; MultiPartType type; - };