From 6686bbdae42e59a915f7ffa8a058ad012d2ae522 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Fri, 23 Aug 2013 14:58:00 -0500 Subject: [PATCH] Surrounds debug code with ifdefs --- src/network/qxtmailmessage.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/network/qxtmailmessage.cpp b/src/network/qxtmailmessage.cpp index 210cfcef..05d8208f 100644 --- a/src/network/qxtmailmessage.cpp +++ b/src/network/qxtmailmessage.cpp @@ -46,6 +46,7 @@ #include #include +//#define QXT_MAIL_MESSAGE_DEBUG 1 struct QxtMailMessagePrivate : public QSharedData { @@ -679,6 +680,9 @@ void QxtRfc2822Parser::parseBody(QxtMailMessagePrivate* msg) { qDebug("regexp %s not valid ! %s", bndRe.pattern().toLatin1().data(), bndRe.errorString().toLatin1().data()); } +#ifdef QXT_MAIL_MESSAGE_DEBUG + bool last = false; +#endif // keep track of the position of two consecutive boundary delimiters: // begin* is the position of the delimiter first character, // end* is the position of the first character of the part following it. @@ -690,7 +694,15 @@ void QxtRfc2822Parser::parseBody(QxtMailMessagePrivate* msg) { beginSecond = bndRe.pos() + bndRe.cap(1).length(); // add length of preceding line break, if any endSecond = bndRe.pos() + bndRe.matchedLength(); +#ifdef QXT_MAIL_MESSAGE_DEBUG +#if QT_VERSION >= 0x040600 + if (bndRe.captureCount() == 2 && bndRe.cap(2) == "--") last = true; +#else + if (bndRe.numCaptures() == 2 && bndRe.cap(2) == "--") last = true; +#endif +#endif +// qDebug("found%s boundary delimiter at position %d.", last?" last":"", beginSecond); // qDebug("%d captures", bndRe.numCaptures()); // foreach(QString capture, bndRe.capturedTexts()) // {