summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2015-08-11 20:57:31 +0200
committerVolker Krause <[email protected]>2015-08-11 20:57:31 +0200
commit8571e708fad9ca550ca2fda0a5511eb384257ed7 (patch)
tree17fab5674be4d6ae64df7c81ab28091652f52633
parent480cd489b0b18c58e351794f1e551de7177fcef7 (diff)
Move away from the overloaded KMime::Headers::* ctors.
They are dangerous to use with implicit ascii casts enabled.
-rw-r--r--kmail/editor/kmcomposewin.cpp4
-rw-r--r--kmail/kmkernel.cpp3
-rw-r--r--messagecomposer/helper/messagefactory.cpp6
-rw-r--r--messagecomposer/helper/messagehelper.cpp4
-rw-r--r--messagecomposer/job/skeletonmessagejob.cpp6
5 files changed, 14 insertions, 9 deletions
diff --git a/kmail/editor/kmcomposewin.cpp b/kmail/editor/kmcomposewin.cpp
index 484ae4e..c19b827 100644
--- a/kmail/editor/kmcomposewin.cpp
+++ b/kmail/editor/kmcomposewin.cpp
@@ -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()) {
diff --git a/kmail/kmkernel.cpp b/kmail/kmkernel.cpp
index 269f250..6a0bd7e 100644
--- a/kmail/kmkernel.cpp
+++ b/kmail/kmkernel.cpp
@@ -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);
}
diff --git a/messagecomposer/helper/messagefactory.cpp b/messagecomposer/helper/messagefactory.cpp
index 11dd965..6b9f119 100644
--- a/messagecomposer/helper/messagefactory.cpp
+++ b/messagecomposer/helper/messagefactory.cpp
@@ -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));
diff --git a/messagecomposer/helper/messagehelper.cpp b/messagecomposer/helper/messagehelper.cpp
index 4183588..91bc78e 100644
--- a/messagecomposer/helper/messagehelper.cpp
+++ b/messagecomposer/helper/messagehelper.cpp
@@ -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);
}
diff --git a/messagecomposer/job/skeletonmessagejob.cpp b/messagecomposer/job/skeletonmessagejob.cpp
index 64833da..4d0f1d5 100644
--- a/messagecomposer/job/skeletonmessagejob.cpp
+++ b/messagecomposer/job/skeletonmessagejob.cpp
@@ -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);
}