Commit d511acc2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15. SkipEmptyParts is part of Qt::.

parent 0578d0d9
......@@ -1940,8 +1940,16 @@ Kleo::KeyResolver::ContactPreferences Kleo::KeyResolver::lookupContactPreference
pref.signingPreference = Kleo::stringToSigningPreference(signPref);
QString cryptoFormats = addr.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF"));
pref.cryptoMessageFormat = Kleo::stringToCryptoMessageFormat(cryptoFormats);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
pref.pgpKeyFingerprints = addr.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("OPENPGPFP")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
pref.pgpKeyFingerprints = addr.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("OPENPGPFP")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
pref.smimeCertFingerprints = addr.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("SMIMEFP")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
pref.smimeCertFingerprints = addr.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("SMIMEFP")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
}
// insert into map and grab resulting iterator
d->mContactPreferencesMap.insert(std::make_pair(address, pref));
......
......@@ -385,8 +385,16 @@ bool MessageComposer::Util::getLinkInformation(const KMime::Message::Ptr &msg, Q
return false;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList messages = hrdLinkMsg->asUnicodeString().split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList messages = hrdLinkMsg->asUnicodeString().split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList types = hrdLinkType->asUnicodeString().split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList types = hrdLinkType->asUnicodeString().split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
if (messages.isEmpty() || types.isEmpty()) {
return false;
......
......@@ -373,7 +373,11 @@ void StringUtilTest::test_parseMailtoUrl()
QCOMPARE(list.count(), numberElement);
if (numberOfTo > 0) {
QCOMPARE(!list.at(0).second.isEmpty(), toIsNotEmpty);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QCOMPARE(list.at(0).second.split(QLatin1String(", "), QString::SkipEmptyParts).count(), numberOfTo);
#else
QCOMPARE(list.at(0).second.split(QLatin1String(", "), Qt::SkipEmptyParts).count(), numberOfTo);
#endif
}
}
......
......@@ -141,7 +141,11 @@ void Filter::setSearchString(const QString &search, QuickSearchLine::SearchOptio
newStr.remove(newStr.length() - 1, 1);
mSearchList = QStringList() << newStr;
} else {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList searchListTmp = mSearchString.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
const QStringList searchListTmp = mSearchString.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
mSearchList.clear();
newStr.clear();
for (const QString &text : searchListTmp) {
......
......@@ -43,7 +43,11 @@ QuickSearchWarning::~QuickSearchWarning()
void QuickSearchWarning::setSearchText(const QString &text)
{
if (!MessageList::MessageListSettings::quickSearchWarningDoNotShowAgain()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList lstText = text.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
const QStringList lstText = text.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
bool foundLessThanThreeCharacters = false;
for (const QString &text : lstText) {
if (text.trimmed().size() < 3) {
......
......@@ -37,7 +37,11 @@ bool DKIMInfo::parseDKIM(const QString &header)
}
QString newHeaders = header;
newHeaders.replace(QLatin1String("; "), QLatin1String(";"));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList items = newHeaders.split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
const QStringList items = newHeaders.split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
bool foundCanonizations = false;
for (int i = 0; i < items.count(); ++i) {
const QString elem = items.at(i).trimmed();
......
......@@ -33,7 +33,11 @@ bool DMARCInfo::parseDMARC(const QString &key)
}
QString cleanKey = key;
cleanKey.replace(QLatin1String("; "), QLatin1String(";"));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList items = cleanKey.split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
const QStringList items = cleanKey.split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
for (int i = 0; i < items.count(); ++i) {
const QString elem = items.at(i).trimmed();
if (elem.startsWith(QLatin1String("v="))) {
......
......@@ -40,7 +40,11 @@ void CallbackTag::render(Grantlee::OutputStream *stream, Grantlee::Context *cont
Grantlee::Node *CallbackTagFactory::getNode(const QString &tagContent, Grantlee::Parser *parser) const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
auto expr = tagContent.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
auto expr = tagContent.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
if (expr.size() != 2) {
return nullptr;
}
......
......@@ -734,7 +734,11 @@ KMime::Content *NodeHelper::contentFromIndex(KMime::Content *node, const QString
{
KMime::Content *c = node->topLevel();
if (c) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList pathParts = persistentIndex.split(QLatin1Char(':'), QString::SkipEmptyParts);
#else
const QStringList pathParts = persistentIndex.split(QLatin1Char(':'), Qt::SkipEmptyParts);
#endif
const int pathPartsSize(pathParts.size());
for (int i = 0; i < pathPartsSize; ++i) {
const QString &path = pathParts[i];
......
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