Hello community, here is the log from the commit of package kmime for openSUSE:Factory checked in at 2018-08-22 14:14:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kmime (Old) and /work/SRC/openSUSE:Factory/.kmime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kmime" Wed Aug 22 14:14:02 2018 rev:36 rq:630146 version:18.08.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kmime/kmime.changes 2018-07-18 22:43:26.533049070 +0200 +++ /work/SRC/openSUSE:Factory/.kmime.new/kmime.changes 2018-08-22 14:14:05.089460584 +0200 @@ -1,0 +2,21 @@ +Thu Aug 16 22:05:25 UTC 2018 - [email protected] + +- Update to 18.08.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.08.0.php +- Changes since 18.07.80: + * None + +------------------------------------------------------------------- +Thu Jul 26 13:00:48 UTC 2018 - [email protected] + +- Update to 18.07.80 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.07.80.php +- Changes since 18.04.3: + * Speed up LFtoCRLF by 20% by not scanning all of it for \r\n. + * Use Q_REQUIRED_RESULT + +------------------------------------------------------------------- Old: ---- kmime-18.04.3.tar.xz New: ---- kmime-18.08.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kmime.spec ++++++ --- /var/tmp/diff_new_pack.1Jk2Ex/_old 2018-08-22 14:14:05.529461627 +0200 +++ /var/tmp/diff_new_pack.1Jk2Ex/_new 2018-08-22 14:14:05.533461636 +0200 @@ -20,11 +20,11 @@ %define kf5_version 5.19.0 Name: kmime -Version: 18.04.3 +Version: 18.08.0 Release: 0 %define kf5_version 5.26.0 # Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA) -%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} +%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} Summary: KDE PIM Libraries: Mime support License: LGPL-2.1-or-later Group: System/GUI/KDE @@ -59,9 +59,7 @@ This package contains necessary include files and libraries needed to develop KDE PIM applications. -%if %{with lang} %lang_package -%endif %prep %setup -q -n kmime-%{version} ++++++ kmime-18.04.3.tar.xz -> kmime-18.08.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/CMakeLists.txt new/kmime-18.08.0/CMakeLists.txt --- old/kmime-18.04.3/CMakeLists.txt 2018-07-10 02:13:56.000000000 +0200 +++ new/kmime-18.08.0/CMakeLists.txt 2018-08-10 02:13:26.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.0) -set(PIM_VERSION "5.8.3") +set(PIM_VERSION "5.9.0") project(KMime VERSION ${PIM_VERSION}) # ECM setup -set(KF5_VERSION "5.44.0") +set(KF5_VERSION "5.47.0") find_package(ECM ${KF5_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${KMime_SOURCE_DIR}/cmake ${ECM_MODULE_PATH}) @@ -22,7 +22,7 @@ set(KMIME_LIB_VERSION ${PIM_VERSION}) -set(QT_REQUIRED_VERSION "5.8.0") +set(QT_REQUIRED_VERSION "5.9.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Core) ecm_setup_version(PROJECT VARIABLE_PREFIX KMIME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/autotests/CMakeLists.txt new/kmime-18.08.0/autotests/CMakeLists.txt --- old/kmime-18.04.3/autotests/CMakeLists.txt 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/autotests/CMakeLists.txt 2018-08-03 18:39:50.000000000 +0200 @@ -1,6 +1,6 @@ include(ECMMarkAsTest) -set(QT_REQUIRED_VERSION "5.8.0") +set(QT_REQUIRED_VERSION "5.9.0") find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED) # Turn exceptions on diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/autotests/utiltest.cpp new/kmime-18.08.0/autotests/utiltest.cpp --- old/kmime-18.04.3/autotests/utiltest.cpp 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/autotests/utiltest.cpp 2018-08-03 18:39:50.000000000 +0200 @@ -231,3 +231,55 @@ QCOMPARE(KMime::isCryptoPart(&c), isCrypto); } +void UtilTest::testLFCRLF_data() +{ + QTest::addColumn<QByteArray>("input"); + QTest::addColumn<QByteArray>("expected"); + QTest::addColumn<QByteArray>("convertedBack"); + + const QByteArray noNewline("no newline character"); + QTest::newRow("none") << noNewline << noNewline << noNewline; + QTest::newRow("alone") << QByteArray("\n") << QByteArray("\r\n") << QByteArray("\n"); + QTest::newRow("CRLF") << QByteArray("\r\n") << QByteArray("\r\n") << QByteArray("\n"); + QTest::newRow("single_first") << QByteArray("\nfoo") << QByteArray("\r\nfoo") << QByteArray("\nfoo"); + QTest::newRow("single_last") << QByteArray("foo\n") << QByteArray("foo\r\n") << QByteArray("foo\n"); + QTest::newRow("single_two_lines") << QByteArray("foo\nbar") << QByteArray("foo\r\nbar") << QByteArray("foo\nbar"); + QTest::newRow("two_lines") << QByteArray("foo\nbar\n") << QByteArray("foo\r\nbar\r\n") << QByteArray("foo\nbar\n"); + QTest::newRow("already_CRLF") << QByteArray("foo\r\nbar\r\n") << QByteArray("foo\r\nbar\r\n") << QByteArray("foo\nbar\n"); + QTest::newRow("mixed_CRLF_LF_unchanged") << QByteArray("foo\r\nbar\n") << QByteArray("foo\r\nbar\n") << QByteArray("foo\nbar\n"); + // out of scope QTest::newRow("mixed_LF_CRLF_unchanged") << QByteArray("foo\nbar\r\n") << QByteArray("foo\nbar\r\n") << QByteArray("foo\nbar\n"); +} + +void UtilTest::testLFCRLF() +{ + QFETCH(QByteArray, input); + QFETCH(QByteArray, expected); + QFETCH(QByteArray, convertedBack); + + const QByteArray output = KMime::LFtoCRLF(input); + QCOMPARE(output, expected); + const QByteArray output2 = KMime::LFtoCRLF(input.constData()); // test the const char* overload + QCOMPARE(output2, expected); + + const QByteArray back = KMime::CRLFtoLF(output); + QCOMPARE(back, convertedBack); +} + +void UtilTest::testLFCRLF_performance() +{ + const QByteArray line = "This is one line\n"; + const int count = 1000; + QByteArray input; + input.reserve(line.size() * count); + for (int i = 0 ; i < count; ++i) { + input += line; + } + + QByteArray output; + QBENCHMARK { + output = KMime::LFtoCRLF(input); + } + QByteArray expected = input; + expected.replace('\n', "\r\n"); + QCOMPARE(output, expected); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/autotests/utiltest.h new/kmime-18.08.0/autotests/utiltest.h --- old/kmime-18.04.3/autotests/utiltest.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/autotests/utiltest.h 2018-08-03 18:39:50.000000000 +0200 @@ -35,6 +35,9 @@ void testIsSigned(); void testIsCryptoPart_data(); void testIsCryptoPart(); + void testLFCRLF_data(); + void testLFCRLF(); + void testLFCRLF_performance(); }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/po/zh_CN/libkmime5.po new/kmime-18.08.0/po/zh_CN/libkmime5.po --- old/kmime-18.04.3/po/zh_CN/libkmime5.po 2018-07-10 02:13:56.000000000 +0200 +++ new/kmime-18.08.0/po/zh_CN/libkmime5.po 2018-08-10 02:13:26.000000000 +0200 @@ -7,7 +7,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2018-02-11 03:21+0100\n" -"PO-Revision-Date: 2018-07-03 17:40\n" +"PO-Revision-Date: 2018-07-24 08:46\n" "Last-Translator: guoyunhebrave <[email protected]>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_charfreq.h new/kmime-18.08.0/src/kmime_charfreq.h --- old/kmime-18.04.3/src/kmime_charfreq.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_charfreq.h 2018-08-03 18:39:50.000000000 +0200 @@ -110,50 +110,50 @@ /** Returns the data #Type as derived from the class heuristics. */ - Type type() const; + Q_REQUIRED_RESULT Type type() const; /** Returns true if the data #Type is EightBitData; false otherwise. */ - bool isEightBitData() const; + Q_REQUIRED_RESULT bool isEightBitData() const; /** Returns true if the data #Type is EightBitText; false otherwise. */ - bool isEightBitText() const; + Q_REQUIRED_RESULT bool isEightBitText() const; /** Returns true if the data #Type is SevenBitData; false otherwise. */ - bool isSevenBitData() const; + Q_REQUIRED_RESULT bool isSevenBitData() const; /** Returns true if the data #Type is SevenBitText; false otherwise. */ - bool isSevenBitText() const; + Q_REQUIRED_RESULT bool isSevenBitText() const; /** Returns true if the data contains trailing whitespace. i.e., if any line ends with space (' ') or tab ('\\t'). */ - bool hasTrailingWhitespace() const; + Q_REQUIRED_RESULT bool hasTrailingWhitespace() const; /** Returns true if the data contains a line that starts with "From ". */ - bool hasLeadingFrom() const; + Q_REQUIRED_RESULT bool hasLeadingFrom() const; /** Returns the percentage of printable characters in the data. The result is undefined if the number of data characters is zero. */ - float printableRatio() const; + Q_REQUIRED_RESULT float printableRatio() const; /** Returns the percentage of control code characters (CTLs) in the data. The result is undefined if the number of data characters is zero. */ - float controlCodesRatio() const; + Q_REQUIRED_RESULT float controlCodesRatio() const; private: //@cond PRIVATE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_codecs.h new/kmime-18.08.0/src/kmime_codecs.h --- old/kmime-18.04.3/src/kmime_codecs.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_codecs.h 2018-08-03 18:39:50.000000000 +0200 @@ -46,14 +46,14 @@ @return the encoded string. */ -QByteArray encodeRFC2047String(const QString &src, const QByteArray &charset, bool addressHeader = false, bool allow8bitHeaders = false); +Q_REQUIRED_RESULT QByteArray encodeRFC2047String(const QString &src, const QByteArray &charset, bool addressHeader = false, bool allow8bitHeaders = false); /** * Same as encodeRFC2047String(), but with a crucial difference: Instead of encoding the complete * string as a single encoded word, the string will be split up at control characters, and only parts of * the sentence that really need to be encoded will be encoded. */ -QByteArray encodeRFC2047Sentence(const QString &src, const QByteArray &charset); +Q_REQUIRED_RESULT QByteArray encodeRFC2047Sentence(const QString &src, const QByteArray &charset); /** Decodes string @p src according to RFC2231 @@ -66,7 +66,7 @@ @return the decoded string. */ -QString decodeRFC2231String(const QByteArray &src, QByteArray &usedCS, const QByteArray &defaultCS = QByteArray(), bool forceCS = false); +Q_REQUIRED_RESULT QString decodeRFC2231String(const QByteArray &src, QByteArray &usedCS, const QByteArray &defaultCS = QByteArray(), bool forceCS = false); /** Encodes string @p src according to RFC2231 using charset @p charset. @@ -75,7 +75,7 @@ @param charset charset to use. @return the encoded string. */ -QByteArray encodeRFC2231String(const QString &src, const QByteArray &charset); +Q_REQUIRED_RESULT QByteArray encodeRFC2231String(const QString &src, const QByteArray &charset); } // namespace KMime diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_content.h new/kmime-18.08.0/src/kmime_content.h --- old/kmime-18.04.3/src/kmime_content.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_content.h 2018-08-03 18:39:50.000000000 +0200 @@ -133,7 +133,7 @@ /** Returns true if this Content object is not empty. */ - bool hasContent() const; + Q_REQUIRED_RESULT bool hasContent() const; /** Sets the Content to the given raw data, containing the Content head and @@ -179,7 +179,7 @@ @since 4.4. @see setFrozen(). */ - bool isFrozen() const; + Q_REQUIRED_RESULT bool isFrozen() const; /** Freezes this Content if @p frozen is true; otherwise unfreezes it. @@ -233,7 +233,7 @@ @see setHead(). */ - QByteArray head() const; + Q_REQUIRED_RESULT QByteArray head() const; /** Sets the Content header raw data. @@ -251,7 +251,7 @@ * Returns all headers. * @since 5.7 */ - QVector<Headers::Base*> headers() const; + Q_REQUIRED_RESULT QVector<Headers::Base*> headers() const; /** Returns the first header of type @p type, if it exists. Otherwise returns 0. @@ -280,7 +280,7 @@ @param type the header type to find @since 4.2 */ - QVector<Headers::Base*> headersByType(const char *type) const; + Q_REQUIRED_RESULT QVector<Headers::Base*> headersByType(const char *type) const; /** Sets the specified header to this Content. @@ -308,7 +308,7 @@ @param type The type of the header to look for. @return true if a header was found and removed. */ - bool removeHeader(const char *type); + Q_REQUIRED_RESULT bool removeHeader(const char *type); /** Searches for the first header of type @p T, and deletes it, removing @@ -324,7 +324,7 @@ @param type The type of the header to look for. */ // TODO probably provide hasHeader<T>() too. - bool hasHeader(const char *type) const; + Q_REQUIRED_RESULT bool hasHeader(const char *type) const; /** Returns the Content-Type header. @@ -374,17 +374,17 @@ (If the encoding is quoted-printable, this is only an approximate size.) This will return 0 for multipart contents or for encapsulated messages. */ - int size(); + Q_REQUIRED_RESULT int size(); /** Returns the size of this Content and all sub-Contents. */ - int storageSize() const; + Q_REQUIRED_RESULT int storageSize() const; /** Line count of this Content and all sub-Contents. */ - int lineCount() const; + Q_REQUIRED_RESULT int lineCount() const; /** Returns the Content body raw data. @@ -394,7 +394,7 @@ @see setBody(). */ - QByteArray body() const; + Q_REQUIRED_RESULT QByteArray body() const; /** Sets the Content body raw data. @@ -415,7 +415,7 @@ @since 4.9 */ - QByteArray preamble() const; + Q_REQUIRED_RESULT QByteArray preamble() const; /** Sets the MIME preamble. @@ -435,7 +435,7 @@ @since 4.9 */ - QByteArray epilogue() const; + Q_REQUIRED_RESULT QByteArray epilogue() const; /** Sets the MIME preamble. @@ -461,7 +461,7 @@ @param useCrLf If true, use @ref CRLF instead of @ref LF for linefeeds. */ - QByteArray encodedContent(bool useCrLf = false); + Q_REQUIRED_RESULT QByteArray encodedContent(bool useCrLf = false); /** * Like encodedContent(), with the difference that only the body will be returned, i.e. the @@ -469,7 +469,7 @@ * * @since 4.6 */ - QByteArray encodedBody(); + Q_REQUIRED_RESULT QByteArray encodedBody(); /** * Returns the decoded Content body. @@ -480,7 +480,7 @@ // TODO: KDE5: BIC: Rename this to decodedBody(), since only the body is returned. // In contrast, setContent() sets the head and the body! // Also, try to make this const. - QByteArray decodedContent(); + Q_REQUIRED_RESULT QByteArray decodedContent(); /** Returns the decoded text. Additional to decodedContent(), this also @@ -497,7 +497,7 @@ */ // TODO: KDE5: BIC: Convert to enums. Also, what if trimText = true but removeTrailingNewlines // is false? - QString decodedText(bool trimText = false, + Q_REQUIRED_RESULT QString decodedText(bool trimText = false, bool removeTrailingNewlines = false); /** @@ -529,14 +529,14 @@ * the primary body part (see textContent()). * @see KMime::isAttachment(), KMime::hasAttachment() */ - QVector<Content*> attachments(); + Q_REQUIRED_RESULT QVector<Content*> attachments(); /** * For multipart contents, this will return a list of all multipart child contents. * For contents that are of mimetype message/rfc822, this will return a list with one entry, * and that entry is the encapsulated message, as it would be returned by bodyAsMessage(). */ - QVector<Content*> contents() const; + Q_REQUIRED_RESULT QVector<Content*> contents() const; /** Adds a new sub-Content. If the sub-Content is already part of another @@ -608,14 +608,14 @@ if the Content is not found within the hierarchy. @param content the Content object to search. */ - ContentIndex indexForContent(Content *content) const; + Q_REQUIRED_RESULT ContentIndex indexForContent(Content *content) const; /** Returns true if this is the top-level node in the MIME tree. The top-level node is always a Message or NewsArticle. However, a node can be a Message without being a top-level node when it is an encapsulated message. */ - bool isTopLevel() const; + Q_REQUIRED_RESULT bool isTopLevel() const; /** * Sets a new parent to the Content and add to its contents list. If it already had a parent, it is removed from the @@ -641,7 +641,7 @@ * Returns the index of this Content based on the topLevel() object. * @since 4.3 */ - ContentIndex index() const; + Q_REQUIRED_RESULT ContentIndex index() const; /** * @return true if this content is an encapsulated message, i.e. if it has the mimetype @@ -650,7 +650,7 @@ * @since 4.5 */ //AK_REVIEW: move to MessageViewer/ObjectTreeParser - bool bodyIsMessage() const; + Q_REQUIRED_RESULT bool bodyIsMessage() const; /** * If this content is an encapsulated message, in which case bodyIsMessage() will return @@ -671,7 +671,7 @@ * @since 4.5 */ //AK_REVIEW: move to MessageViewer/ObjectTreeParser - QSharedPointer<Message> bodyAsMessage() const; + Q_REQUIRED_RESULT QSharedPointer<Message> bodyAsMessage() const; protected: /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_contentindex.h new/kmime-18.08.0/src/kmime_contentindex.h --- old/kmime-18.04.3/src/kmime_contentindex.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_contentindex.h 2018-08-03 18:39:50.000000000 +0200 @@ -80,7 +80,7 @@ /** Returns true if this index is non-empty (valid). */ - bool isValid() const; + Q_REQUIRED_RESULT bool isValid() const; /** Removes and returns the top-most index. Used to recursively @@ -88,7 +88,7 @@ @see push(), up(). */ - unsigned int pop(); + Q_REQUIRED_RESULT unsigned int pop(); /** Adds @p index to the content index. Used when ascending the message @@ -106,27 +106,27 @@ @see push(), pop(). */ - unsigned int up(); + Q_REQUIRED_RESULT unsigned int up(); /** Returns a string representation of this content index according to @ref RFC3501 section 6.4.5. */ - QString toString() const; + Q_REQUIRED_RESULT QString toString() const; /** Compares this with @p index for equality. @param index is the content index to compare. */ - bool operator==(const ContentIndex &index) const; + Q_REQUIRED_RESULT bool operator==(const ContentIndex &index) const; /** Compares this with @p index for inequality. @param index is the content index to compare. */ - bool operator!=(const ContentIndex &index) const; + Q_REQUIRED_RESULT bool operator!=(const ContentIndex &index) const; /** Assignment operator. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_dateformatter.h new/kmime-18.08.0/src/kmime_dateformatter.h --- old/kmime-18.04.3/src/kmime_dateformatter.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_dateformatter.h 2018-08-03 18:39:50.000000000 +0200 @@ -101,7 +101,7 @@ @see setFormat(). */ - FormatType format() const; + Q_REQUIRED_RESULT FormatType format() const; /** Sets the date format to @p ftype. @@ -122,7 +122,7 @@ @return a QString containing the formatted date. */ - QString dateString(time_t t, const QString &lang = QString(), + Q_REQUIRED_RESULT QString dateString(time_t t, const QString &lang = QString(), bool shortFormat = true) const; /** @@ -135,7 +135,7 @@ @return a QString containing the formatted date. */ - QString dateString(const QDateTime &dtime, const QString &lang = QString(), + Q_REQUIRED_RESULT QString dateString(const QDateTime &dtime, const QString &lang = QString(), bool shortFormat = true) const; /** @@ -155,7 +155,7 @@ @see setCustomFormat(). */ - QString customFormat() const; + Q_REQUIRED_RESULT QString customFormat() const; //static methods /** @@ -170,7 +170,7 @@ @return a QString containing the formatted date. */ - static QString formatDate(DateFormatter::FormatType ftype, time_t t, + Q_REQUIRED_RESULT static QString formatDate(DateFormatter::FormatType ftype, time_t t, const QString &data = QString(), bool shortFormat = true); @@ -186,7 +186,7 @@ @return a QString containing the formatted date. */ - static QString formatCurrentDate(DateFormatter::FormatType ftype, + Q_REQUIRED_RESULT static QString formatCurrentDate(DateFormatter::FormatType ftype, const QString &data = QString(), bool shortFormat = true); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_header_parsing.h new/kmime-18.08.0/src/kmime_header_parsing.h --- old/kmime-18.04.3/src/kmime_header_parsing.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_header_parsing.h 2018-08-03 18:39:50.000000000 +0200 @@ -77,7 +77,7 @@ @return true if the input string was successfully decode; false otherwise. */ -KMIME_EXPORT bool parseEncodedWord(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseEncodedWord(const char *&scursor, const char *const send, QString &result, QByteArray &language, QByteArray &usedCS, const QByteArray &defaultCS = QByteArray(), @@ -89,10 +89,10 @@ /** You may or may not have already started parsing into the atom. This function will go on where you left off. */ -KMIME_EXPORT bool parseAtom(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAtom(const char *&scursor, const char *const send, QString &result, bool allow8Bit = false); -KMIME_EXPORT bool parseAtom(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAtom(const char *&scursor, const char *const send, QPair<const char *, int> &result, bool allow8Bit = false); @@ -105,22 +105,22 @@ }; Q_DECLARE_FLAGS(ParseTokenFlags, ParseTokenFlag) -KMIME_EXPORT bool parseToken(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseToken(const char *&scursor, const char *const send, QString &result, ParseTokenFlags flags = ParseTokenNoFlag); -KMIME_EXPORT bool parseToken(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseToken(const char *&scursor, const char *const send, QPair<const char *, int> &result, ParseTokenFlags flags = ParseTokenNoFlag); /** @p scursor must be positioned after the opening openChar. */ -KMIME_EXPORT bool parseGenericQuotedString(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseGenericQuotedString(const char *&scursor, const char *const send, QString &result, bool isCRLF, const char openChar = '"', const char closeChar = '"'); /** @p scursor must be positioned right after the opening '(' */ -KMIME_EXPORT bool parseComment(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseComment(const char *&scursor, const char *const send, QString &result, bool isCRLF = false, bool reallySave = true); @@ -139,7 +139,7 @@ @return true if the input phrase was successfully parsed; false otherwise. */ -KMIME_EXPORT bool parsePhrase(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parsePhrase(const char *&scursor, const char *const send, QString &result, bool isCRLF = false); /** @@ -154,7 +154,7 @@ @return true if the input phrase was successfully parsed; false otherwise. */ -KMIME_EXPORT bool parseDotAtom(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseDotAtom(const char *&scursor, const char *const send, QString &result, bool isCRLF = false); /** @@ -174,17 +174,17 @@ KMIME_EXPORT void eatCFWS(const char *&scursor, const char *const send, bool isCRLF); -KMIME_EXPORT bool parseDomain(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseDomain(const char *&scursor, const char *const send, QString &result, bool isCRLF = false); -KMIME_EXPORT bool parseObsRoute(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseObsRoute(const char *&scursor, const char *const send, QStringList &result, bool isCRLF = false, bool save = false); -KMIME_EXPORT bool parseAddrSpec(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAddrSpec(const char *&scursor, const char *const send, Types::AddrSpec &result, bool isCRLF = false); -KMIME_EXPORT bool parseAngleAddr(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAngleAddr(const char *&scursor, const char *const send, Types::AddrSpec &result, bool isCRLF = false); /** @@ -203,30 +203,30 @@ @param result the parsing result @param isCRLF true if input string is terminated with a CRLF. */ -KMIME_EXPORT bool parseMailbox(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseMailbox(const char *&scursor, const char *const send, Types::Mailbox &result, bool isCRLF = false); -KMIME_EXPORT bool parseGroup(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseGroup(const char *&scursor, const char *const send, Types::Address &result, bool isCRLF = false); -KMIME_EXPORT bool parseAddress(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAddress(const char *&scursor, const char *const send, Types::Address &result, bool isCRLF = false); -KMIME_EXPORT bool parseAddressList(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseAddressList(const char *&scursor, const char *const send, Types::AddressList &result, bool isCRLF = false); -KMIME_EXPORT bool parseParameter(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseParameter(const char *&scursor, const char *const send, QPair<QString, Types::QStringOrQPair> &result, bool isCRLF = false); -KMIME_EXPORT bool parseParameterList(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseParameterList(const char *&scursor, const char *const send, QMap<QString, QString> &result, bool isCRLF = false); -KMIME_EXPORT bool parseRawParameterList(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseRawParameterList(const char *&scursor, const char *const send, QMap<QString, Types::QStringOrQPair> &result, bool isCRLF = false); @@ -236,7 +236,7 @@ * * @since 4.5 */ -KMIME_EXPORT bool parseParameterListWithCharset(const char *&scursor, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseParameterListWithCharset(const char *&scursor, const char *const send, QMap<QString, QString> &result, QByteArray &charset, bool isCRLF = false); @@ -248,14 +248,14 @@ @param result the parsing result @returns The number of parsed digits (don't confuse with @p result!) */ -KMIME_EXPORT int parseDigits(const char *&scursor, const char *const send, int &result); +Q_REQUIRED_RESULT KMIME_EXPORT int parseDigits(const char *&scursor, const char *const send, int &result); -KMIME_EXPORT bool parseTime(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseTime(const char *&scursor, const char *const send, int &hour, int &min, int &sec, long int &secsEastOfGMT, bool &timeZoneKnown, bool isCRLF = false); -KMIME_EXPORT bool parseDateTime(const char *&scursor, const char *const send, +Q_REQUIRED_RESULT KMIME_EXPORT bool parseDateTime(const char *&scursor, const char *const send, QDateTime &result, bool isCRLF = false); /** @@ -264,7 +264,7 @@ * * @since 4.4 */ -KMIME_EXPORT KMime::Headers::Base *extractFirstHeader(QByteArray &head); +Q_REQUIRED_RESULT KMIME_EXPORT KMime::Headers::Base *extractFirstHeader(QByteArray &head); /** * Extract the header header and the body from a complete content. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_header_parsing_p.h new/kmime-18.08.0/src/kmime_header_parsing_p.h --- old/kmime-18.04.3/src/kmime_header_parsing_p.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_header_parsing_p.h 2018-08-03 18:39:50.000000000 +0200 @@ -33,7 +33,7 @@ namespace HeaderParsing { -QVector<KMime::Headers::Base *> parseHeaders(const QByteArray &head); +Q_REQUIRED_RESULT QVector<KMime::Headers::Base *> parseHeaders(const QByteArray &head); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_headers.h new/kmime-18.08.0/src/kmime_headers.h --- old/kmime-18.04.3/src/kmime_headers.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_headers.h 2018-08-03 18:39:50.000000000 +0200 @@ -144,12 +144,12 @@ Returns the encoded header. @param withHeaderType Specifies whether the header-type should be included. */ - virtual QByteArray as7BitString(bool withHeaderType = true) const = 0; + Q_REQUIRED_RESULT virtual QByteArray as7BitString(bool withHeaderType = true) const = 0; /** Returns the charset that is used for RFC2047-encoding. */ - QByteArray rfc2047Charset() const; + Q_REQUIRED_RESULT QByteArray rfc2047Charset() const; /** Sets the charset for RFC2047-encoding. @@ -191,12 +191,12 @@ /** Checks if this header is of type @p t. */ - bool is(const char *t) const; + Q_REQUIRED_RESULT bool is(const char *t) const; /** Checks if this header is a MIME header. */ - bool isMimeHeader() const; + Q_REQUIRED_RESULT bool isMimeHeader() const; protected: /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_message.h new/kmime-18.08.0/src/kmime_message.h --- old/kmime-18.04.3/src/kmime_message.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_message.h 2018-08-03 18:39:50.000000000 +0200 @@ -93,7 +93,7 @@ /** Destroys this Message. */ - ~Message(); + ~Message() override; /** Returns the Message-ID header. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_parsers.h new/kmime-18.08.0/src/kmime_parsers.h --- old/kmime-18.04.3/src/kmime_parsers.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_parsers.h 2018-08-03 18:39:50.000000000 +0200 @@ -41,16 +41,16 @@ public: MultiPart(const QByteArray &src, const QByteArray &boundary); - bool parse(); - QVector<QByteArray> parts() const + Q_REQUIRED_RESULT bool parse(); + Q_REQUIRED_RESULT QVector<QByteArray> parts() const { return m_parts; } - QByteArray preamble() const + Q_REQUIRED_RESULT QByteArray preamble() const { return m_preamble; } - QByteArray epilouge() const + Q_REQUIRED_RESULT QByteArray epilouge() const { return m_epilouge; } @@ -70,35 +70,35 @@ explicit NonMimeParser(const QByteArray &src); virtual ~NonMimeParser(); virtual bool parse() = 0; - bool isPartial() const + Q_REQUIRED_RESULT bool isPartial() const { return (m_partNr > -1 && m_totalNr > -1 && m_totalNr != 1); } - int partialNumber() const + Q_REQUIRED_RESULT int partialNumber() const { return m_partNr; } - int partialCount() const + Q_REQUIRED_RESULT int partialCount() const { return m_totalNr; } - bool hasTextPart() const + Q_REQUIRED_RESULT bool hasTextPart() const { return (m_text.length() > 1); } - QByteArray textPart() const + Q_REQUIRED_RESULT QByteArray textPart() const { return m_text; } - QVector<QByteArray> binaryParts() const + Q_REQUIRED_RESULT QVector<QByteArray> binaryParts() const { return m_bins; } - QVector<QByteArray> filenames() const + Q_REQUIRED_RESULT QVector<QByteArray> filenames() const { return m_filenames; } - QVector<QByteArray> mimeTypes() const + Q_REQUIRED_RESULT QVector<QByteArray> mimeTypes() const { return m_mimeTypes; } @@ -120,7 +120,7 @@ public: UUEncoded(const QByteArray &src, const QByteArray &subject); - bool parse() override; + Q_REQUIRED_RESULT bool parse() override; private: QByteArray m_subject; @@ -135,7 +135,7 @@ public: explicit YENCEncoded(const QByteArray &src); - bool parse() override; + Q_REQUIRED_RESULT bool parse() override; private: static bool yencMeta(QByteArray &src, const QByteArray &name, int *value); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_types.h new/kmime-18.08.0/src/kmime_types.h --- old/kmime-18.04.3/src/kmime_types.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_types.h 2018-08-03 18:39:50.000000000 +0200 @@ -57,14 +57,14 @@ Returns a string representation of the email address, without the angle brackets. */ - QByteArray address() const; + Q_REQUIRED_RESULT QByteArray address() const; - AddrSpec addrSpec() const; + Q_REQUIRED_RESULT AddrSpec addrSpec() const; /** Returns the display name. */ - QString name() const; + Q_REQUIRED_RESULT QString name() const; /** Sets the email address. @@ -90,12 +90,12 @@ /** Returns true if this mailbox has an address. */ - bool hasAddress() const; + Q_REQUIRED_RESULT bool hasAddress() const; /** Returns true if this mailbox has a display name. */ - bool hasName() const; + Q_REQUIRED_RESULT bool hasName() const; /** * Describes how display names should be quoted @@ -116,7 +116,7 @@ * @param quoting describes how the display name should be quoted * @since 4.5 */ - QString prettyAddress(Quoting quoting = QuoteNever) const; + Q_REQUIRED_RESULT QString prettyAddress(Quoting quoting = QuoteNever) const; /** Parses the given unicode string. @@ -133,28 +133,28 @@ @param encCharset The charset used for encoding. */ - QByteArray as7BitString(const QByteArray &encCharset) const; + Q_REQUIRED_RESULT QByteArray as7BitString(const QByteArray &encCharset) const; /** * Returns a list of mailboxes from an unicode string. * * @since 5.14 */ - static QVector<Mailbox> listFromUnicodeString(const QString &s); + Q_REQUIRED_RESULT static QVector<Mailbox> listFromUnicodeString(const QString &s); /** * Returns a list of mailboxes from an encoded 7bit string. * * @since 5.14 */ - static QVector<Mailbox> listFrom7BitString(const QByteArray &s); + Q_REQUIRED_RESULT static QVector<Mailbox> listFrom7BitString(const QByteArray &s); /** * Returns a unicode string representing the given list of mailboxes. * * @since 5.15 */ - static QString listToUnicodeString(const QVector<Mailbox> &mailboxes); + Q_REQUIRED_RESULT static QString listToUnicodeString(const QVector<Mailbox> &mailboxes); private: QString mDisplayName; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_util.cpp new/kmime-18.08.0/src/kmime_util.cpp --- old/kmime-18.04.3/src/kmime_util.cpp 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_util.cpp 2018-08-03 18:39:50.000000000 +0200 @@ -389,7 +389,14 @@ QByteArray LFtoCRLF(const QByteArray &s) { - if (s.contains("\r\n")) { + const int firstNewline = s.indexOf('\n'); + if (firstNewline == -1) { + return s; + } + if (firstNewline > 0 && s.at(firstNewline - 1) == '\r') { + // We found \r\n already, don't change anything + // This check assumes that input is consistent in terms of newlines, + // but so did if (s.contains("\r\n")), too. return s; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kmime-18.04.3/src/kmime_util.h new/kmime-18.08.0/src/kmime_util.h --- old/kmime-18.04.3/src/kmime_util.h 2018-06-12 08:18:59.000000000 +0200 +++ new/kmime-18.08.0/src/kmime_util.h 2018-08-03 18:39:50.000000000 +0200 @@ -55,7 +55,7 @@ @param data the data to check encodings for @ since 4.4 */ -KMIME_EXPORT QVector<KMime::Headers::contentEncoding> encodingsForData(const QByteArray &data); +Q_REQUIRED_RESULT KMIME_EXPORT QVector<KMime::Headers::contentEncoding> encodingsForData(const QByteArray &data); /** * Set whether or not to use outlook compatible attachment filename encoding. Outlook
