Commit 8571e708 authored by Volker Krause's avatar Volker Krause

Move away from the overloaded KMime::Headers::* ctors.

They are dangerous to use with implicit ascii casts enabled.
parent 480cd489
......@@ -3016,8 +3016,8 @@ void KMComposeWin::slotIdentityChanged(uint uoid, bool initalChange)
if (ident.organization().isEmpty()) {
mMsg->organization()->clear();
} else {
KMime::Headers::Organization *const organization
= new KMime::Headers::Organization(mMsg.data(), ident.organization(), "utf-8");
KMime::Headers::Organization *const organization = new KMime::Headers::Organization(mMsg.data());
organization->fromUnicodeString(ident.organization(), "utf-8");
mMsg->setHeader(organization);
}
if (!ident.isXFaceEnabled() || ident.xface().isEmpty()) {
......
......@@ -591,7 +591,8 @@ int KMKernel::openComposer(const QString &to, const QString &cc,
}
if (!inReplyTo.isEmpty()) {
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(msg.data(), inReplyTo, "utf-8");
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(msg.data());
header->fromUnicodeString(inReplyTo, "utf-8");
msg->setHeader(header);
}
......
......@@ -556,7 +556,8 @@ KMime::Message::Ptr MessageFactory::createRedirect(const QString &toStr, const Q
msg->setHeader(header);
if (msg->to(false)) {
KMime::Headers::To *headerT = new KMime::Headers::To(msg.data(), m_origMsg->to()->asUnicodeString(), "utf-8");
KMime::Headers::To *headerT = new KMime::Headers::To(msg.data());
headerT->fromUnicodeString(m_origMsg->to()->asUnicodeString(), "utf-8");
msg->setHeader(headerT);
}
......@@ -710,7 +711,8 @@ KMime::Message::Ptr MessageFactory::createMDN(KMime::MDN::ActionMode a,
receipt->to()->fromUnicodeString(receiptTo, "utf-8");
//Laurent: We don't translate subject ?
receipt->subject()->from7BitString("Message Disposition Notification");
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(receipt.data(), m_origMsg->messageID()->asUnicodeString(), "utf-8");
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(receipt.data());
header->fromUnicodeString(m_origMsg->messageID()->asUnicodeString(), "utf-8");
receipt->setHeader(header);
receipt->references()->from7BitString(getRefStr(m_origMsg));
......
......@@ -110,8 +110,8 @@ void applyIdentity(const KMime::Message::Ptr &message, const KIdentityManagement
if (ident.organization().isEmpty()) {
message->removeHeader("Organization");
} else {
KMime::Headers::Organization *const organization
= new KMime::Headers::Organization(message.data(), ident.organization(), "utf-8");
KMime::Headers::Organization *const organization = new KMime::Headers::Organization(message.data());
organization->fromUnicodeString(ident.organization(), "utf-8");
message->setHeader(organization);
}
......
......@@ -195,13 +195,15 @@ void SkeletonMessageJobPrivate::doStart()
// In-Reply-To
if (!infoPart->inReplyTo().isEmpty()) {
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(message, infoPart->inReplyTo(), "utf-8");
KMime::Headers::InReplyTo *header = new KMime::Headers::InReplyTo(message);
header->fromUnicodeString(infoPart->inReplyTo(), "utf-8");
message->setHeader(header);
}
// References
if (!infoPart->references().isEmpty()) {
KMime::Headers::References *header = new KMime::Headers::References(message, infoPart->references(), "utf-8");
KMime::Headers::References *header = new KMime::Headers::References(message);
header->fromUnicodeString(infoPart->references(), "utf-8");
message->setHeader(header);
}
......
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