diff --git a/src/mimecontentformatter.cpp b/src/mimecontentformatter.cpp index 1a43bd1..7f5a6e4 100644 --- a/src/mimecontentformatter.cpp +++ b/src/mimecontentformatter.cpp @@ -22,7 +22,7 @@ MimeContentFormatter::MimeContentFormatter(int max_length) : max_length(max_length) {} -QString MimeContentFormatter::format(const QString &content, bool quotedPrintable) { +QString MimeContentFormatter::format(const QString &content, bool quotedPrintable) const { QString out; @@ -43,7 +43,7 @@ QString MimeContentFormatter::format(const QString &content, bool quotedPrintabl } if ((chars > max_length - 1) - || ((content[i] == '=') && (chars > max_length - 3) )) { + || ((content[i] == '=') && (chars > max_length - 3) )) { out.append('='); out.append("\r\n"); chars = 1; @@ -60,3 +60,7 @@ QString MimeContentFormatter::format(const QString &content, bool quotedPrintabl void MimeContentFormatter::setMaxLength(int l) { max_length = l; } + +int MimeContentFormatter::getMaxLength() const { + return max_length; +} diff --git a/src/mimecontentformatter.h b/src/mimecontentformatter.h index 3ddbcf9..8180cb6 100644 --- a/src/mimecontentformatter.h +++ b/src/mimecontentformatter.h @@ -29,8 +29,9 @@ public: MimeContentFormatter (int max_length = 76); void setMaxLength(int l); + int getMaxLength() const; - QString format(const QString &content, bool quotedPrintable = false); + QString format(const QString &content, bool quotedPrintable = false) const; protected: int max_length; diff --git a/src/mimefile.cpp b/src/mimefile.cpp index 6a4e4c3..59fb5bf 100644 --- a/src/mimefile.cpp +++ b/src/mimefile.cpp @@ -31,6 +31,7 @@ MimeFile::MimeFile(QFile *file) MimeFile::~MimeFile() { + delete file; } /* [1] --- */ diff --git a/src/mimepart.cpp b/src/mimepart.cpp index 4a498d2..07ff662 100644 --- a/src/mimepart.cpp +++ b/src/mimepart.cpp @@ -113,6 +113,11 @@ MimePart::Encoding MimePart::getEncoding() const return this->cEncoding; } +MimeContentFormatter& MimePart::getContentFormatter() +{ + return this->formatter; +} + /* [2] --- */ diff --git a/src/mimepart.h b/src/mimepart.h index 8c5539f..3eda975 100644 --- a/src/mimepart.h +++ b/src/mimepart.h @@ -72,6 +72,8 @@ public: void setEncoding(Encoding enc); Encoding getEncoding() const; + MimeContentFormatter& getContentFormatter(); + /* [2] --- */