Commit 5f675aa4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

QString::split(..., Qt::SplitBehavior, ...) is already in Qt 5.14

parent 7c187fcf
Pipeline #47729 passed with stage
in 41 minutes and 3 seconds
......@@ -1902,16 +1902,8 @@ 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));
......
......@@ -388,16 +388,8 @@ 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;
......
......@@ -359,11 +359,7 @@ 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
}
}
......
......@@ -129,11 +129,7 @@ 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) {
......
......@@ -31,11 +31,7 @@ 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) {
......
......@@ -22,11 +22,7 @@ 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();
......
......@@ -20,11 +20,7 @@ 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="))) {
......
......@@ -27,11 +27,7 @@ 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;
}
......
......@@ -697,11 +697,7 @@ QString Util::parseBodyStyle(const QString &style)
const int indexEnd = style.indexOf(QLatin1Char('"'), indexStyle + 7);
if (indexEnd != -1) {
const QStringRef styleStr = style.midRef(indexStyle + 7, indexEnd - (indexStyle + 7));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const auto lstStyle = styleStr.split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
const auto lstStyle = styleStr.split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
QStringList lst;
for (const auto &style : lstStyle) {
if (!style.trimmed().contains(QLatin1String("white-space"))) {
......
......@@ -719,11 +719,7 @@ 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