Commit 4e95c2fc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add missing Q_REQUIRED_RESULT + remove not necessary qregexp

parent 5809c74e
......@@ -915,19 +915,13 @@ QString MessageFactoryNG::replaceHeadersInString(const KMime::Message::Ptr &msg,
QRegExp rx(QStringLiteral("\\$\\{([a-z0-9-]+)\\}"), Qt::CaseInsensitive);
Q_ASSERT(rx.isValid());
QRegExp rxDate(QStringLiteral("\\$\\{date\\}"));
Q_ASSERT(rxDate.isValid());
const QString sDate = KMime::DateFormatter::formatDate(
KMime::DateFormatter::Localized, msg->date()->dateTime().toSecsSinceEpoch());
qCDebug(MESSAGECOMPOSER_LOG) << "creating mdn date:" << msg->date()->dateTime().toSecsSinceEpoch() << sDate;
int idx = 0;
if ((idx = rxDate.indexIn(result, idx)) != -1) {
result.replace(idx, rxDate.matchedLength(), sDate);
}
result.replace(QStringLiteral("${date}"), sDate);
idx = 0;
int idx = 0;
while ((idx = rx.indexIn(result, idx)) != -1) {
const QByteArray ba = rx.cap(1).toLatin1();
QString replacement;
......
......@@ -232,9 +232,9 @@ private:
Searches the "x-kmail-identity" header and if that fails,
searches with KIdentityManagement::IdentityManager::identityForAddress()
**/
uint identityUoid(const KMime::Message::Ptr &msg);
Q_REQUIRED_RESULT uint identityUoid(const KMime::Message::Ptr &msg);
QString replaceHeadersInString(const KMime::Message::Ptr &msg, const QString &s);
Q_REQUIRED_RESULT QString replaceHeadersInString(const KMime::Message::Ptr &msg, const QString &s);
/*
* If force charset option is enabled, try to set the original charset
......@@ -243,7 +243,7 @@ private:
*/
void applyCharset(const KMime::Message::Ptr msg);
QByteArray getRefStr(const KMime::Message::Ptr &msg);
Q_REQUIRED_RESULT QByteArray getRefStr(const KMime::Message::Ptr &msg);
KMime::Content *createForwardAttachmentMessage(const KMime::Message::Ptr &fwdMsg);
KIdentityManagement::IdentityManager *m_identityManager = nullptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment