Commit 976b92da authored by Laurent Montel's avatar Laurent Montel 😁

Compile with QT_NO_CAST_FROM_BYTEARRAY

parent 66357f09
......@@ -87,7 +87,6 @@ set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libx
#add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
add_definitions( -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT )
add_definitions("-DQT_NO_CAST_TO_ASCII")
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
remove_definitions( -DQT_NO_CAST_FROM_ASCII )
#add_definitions( -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 )
......
......@@ -67,9 +67,9 @@ FilterAction::ReturnCode FilterActionRemoveHeader::process(ItemContext &context,
KMime::Message::Ptr msg = context.item().payload<KMime::Message::Ptr>();
const QByteArray param(mParameter.toLatin1());
bool headerRemove = false;
while (msg->headerByType(param)) {
while (msg->headerByType(param.constData())) {
headerRemove = true;
msg->removeHeader(param);
msg->removeHeader(param.constData());
}
if (headerRemove) {
msg->assemble();
......
......@@ -42,7 +42,7 @@ FilterAction::ReturnCode FilterActionReplyTo::process(ItemContext &context, bool
const QByteArray replyTo("Reply-To");
KMime::Headers::Base *header = KMime::Headers::createHeader(replyTo);
if (!header) {
header = new KMime::Headers::Generic(replyTo);
header = new KMime::Headers::Generic(replyTo.constData());
}
header->fromUnicodeString(mParameter, "utf-8");
msg->setHeader(header);
......
......@@ -78,7 +78,7 @@ FilterAction::ReturnCode FilterActionRewriteHeader::process(ItemContext &context
const KMime::Message::Ptr msg = context.item().payload<KMime::Message::Ptr>();
const QByteArray param(mParameter.toLatin1());
KMime::Headers::Base *header = msg->headerByType(param);
KMime::Headers::Base *header = msg->headerByType(param.constData());
if (!header) {
return GoOn; //TODO: Maybe create a new header by type?
}
......@@ -87,11 +87,11 @@ FilterAction::ReturnCode FilterActionRewriteHeader::process(ItemContext &context
const QString oldValue = value;
const QString newValue = value.replace(mRegExp, mReplacementString);
if (newValue != oldValue) {
msg->removeHeader(param);
msg->removeHeader(param.constData());
KMime::Headers::Base *newheader = KMime::Headers::createHeader(param);
if (!newheader) {
newheader = new KMime::Headers::Generic(param);
newheader = new KMime::Headers::Generic(param.constData());
}
newheader->fromUnicodeString(newValue, "utf-8");
msg->setHeader(newheader);
......
......@@ -156,7 +156,7 @@ void substituteMessageHeaders(const KMime::Message::Ptr &aMsg, QString &result)
QRegExp header_rx(QStringLiteral("%\\{([a-z0-9-]+)\\}"), Qt::CaseInsensitive);
int idx = 0;
while ((idx = header_rx.indexIn(result, idx)) != -1) {
const KMime::Headers::Base *header = aMsg->headerByType(header_rx.cap(1).toLatin1());
const KMime::Headers::Base *header = aMsg->headerByType(header_rx.cap(1).toLatin1().constData());
QString replacement;
if (header) {
replacement = KShell::quoteArg(QString::fromLatin1(header->as7BitString()));
......
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