Commit b9aed567 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compiles with QT_NO_CAST_FROM_BYTEARRAY

parent a6200c6c
......@@ -10,8 +10,6 @@ ecm_setup_version(${MESSAGELIB_LIB_VERSION} VARIABLE_PREFIX MIMETREEPARSER
########### Targets ###########
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
#verify
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MimeTreeParser")
......
......@@ -28,7 +28,7 @@
void MimeTreeParser::Test::setupEnv()
{
setenv("LC_ALL", "C", 1);
setenv("KDEHOME", QFile::encodeName(QDir::homePath() + QString::fromLatin1("/.qttest")), 1);
setenv("KDEHOME", QFile::encodeName(QDir::homePath() + QString::fromLatin1("/.qttest")).constData(), 1);
QStandardPaths::setTestModeEnabled(true);
}
......@@ -114,7 +114,7 @@ Interface::MessagePart::Ptr MailmanBodyPartFormatter::process(Interface::BodyPar
digestHeaderStr += str.midRef(0, thisDelim);
MessagePartList::Ptr mpl(new MessagePartList(part.objectTreeParser()));
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), digestHeaderStr.toLatin1(), "Digest Header"));
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), digestHeaderStr.toLatin1().constData(), "Digest Header"));
//mReader->queueHtml("<br><hr><br>");
// temporarily change curent node's Content-Type
// to get our embedded RfC822 messages properly inserted
......@@ -151,7 +151,7 @@ Interface::MessagePart::Ptr MailmanBodyPartFormatter::process(Interface::BodyPar
}
}
qCDebug(MIMETREEPARSER_LOG) << " embedded message found: \"" << subject;
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), partStr.toLatin1(), subject.toLatin1()));
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), partStr.toLatin1().constData(), subject.toLatin1().constData()));
//mReader->queueHtml("<br><hr><br>");
thisDelim = nextDelim + 1;
nextDelim = str.indexOf(delim1, thisDelim, Qt::CaseInsensitive);
......@@ -179,6 +179,6 @@ Interface::MessagePart::Ptr MailmanBodyPartFormatter::process(Interface::BodyPar
}
partStr = QStringLiteral("Content-Type: text/plain\nContent-Description: digest footer\n\n");
partStr += str.midRef(thisDelim);
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), partStr.toLatin1(), "Digest Footer"));
mpl->appendSubPart(createAndParseTempNode(part, part.topLevelContent(), partStr.toLatin1().constData(), "Digest Footer"));
return mpl;
}
......@@ -211,8 +211,8 @@ bool ObjectTreeParser::printing() const
bool ObjectTreeParser::processType(KMime::Content *node, ProcessResult &processResult, const QByteArray &mediaType, const QByteArray &subType, Interface::MessagePartPtr &mpRet)
{
bool bRendered = false;
const auto sub = mSource->bodyPartFormatterFactory()->subtypeRegistry(mediaType);
auto range = sub.equal_range(subType);
const auto sub = mSource->bodyPartFormatterFactory()->subtypeRegistry(mediaType.constData());
auto range = sub.equal_range(subType.constData());
for (auto it = range.first; it != range.second; ++it) {
const auto formatter = (*it).second;
if (!formatter) {
......
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