Commit 212a9099 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

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

parent 2b68edaf
......@@ -879,7 +879,11 @@ void POP3Protocol::get(const QUrl &url)
finished();
//m_cmd = CMD_NONE;
} else if (cmd == QLatin1String("download") || cmd == QLatin1String("headers")) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList waitingCommands = path.split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList waitingCommands = path.split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
if (waitingCommands.isEmpty()) {
qCDebug(POP3_LOG) << "tried to request" << cmd << "for" << path << "with no specific item to get";
closeConnection();
......
......@@ -39,7 +39,11 @@ static const QMap<QString, QCA::CertificateInfoTypeKnown> stringToKnownCertInfoT
static QMultiMap<QCA::CertificateInfoType, QString> parseCertSubjectInfo(const QString &info)
{
QMultiMap<QCA::CertificateInfoType, QString> map;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &token : info.split(QLatin1Char(','), QString::SkipEmptyParts)) {
#else
for (const auto &token : info.split(QLatin1Char(','), Qt::SkipEmptyParts)) {
#endif
const auto keyval = token.trimmed().split(QLatin1Char('='));
if (keyval.count() == 2) {
if (stringToKnownCertInfoType.contains(keyval[0])) {
......
......@@ -162,7 +162,11 @@ AccountPtr GoogleAccountManager::findAccountInWallet(const QString &accountName)
QMap<QString, QString> map;
m_wallet->readMap(accountName, map);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList scopes = map[QStringLiteral("scopes")].split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList scopes = map[QStringLiteral("scopes")].split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
QList<QUrl> scopeUrls;
scopeUrls.reserve(scopes.count());
for (const QString &scope : scopes) {
......
......@@ -122,7 +122,11 @@ Akonadi::Collection ImapTestBase::createCollectionChain(const QString &remoteId)
Akonadi::Collection collection = parent;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList collections = remoteId.split(separator, QString::SkipEmptyParts);
#else
const QStringList collections = remoteId.split(separator, Qt::SkipEmptyParts);
#endif
Q_FOREACH (const QString &colId, collections) {
collection = Akonadi::Collection(id);
collection.setRemoteId(separator + colId);
......
......@@ -120,7 +120,11 @@ Akonadi::Collection ImapTestBase::createCollectionChain(const QString &remoteId)
Akonadi::Collection collection = parent;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList collections = remoteId.split(separator, QString::SkipEmptyParts);
#else
const QStringList collections = remoteId.split(separator, Qt::SkipEmptyParts);
#endif
Q_FOREACH (const QString &colId, collections) {
collection = Akonadi::Collection(id);
collection.setRemoteId(separator + colId);
......
......@@ -776,7 +776,11 @@ Kolab::Contact fromKABC(const KContacts::Addressee &addressee)
Kolab::Crypto crypto;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList protocolPrefs = addressee.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF")).split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList protocolPrefs = addressee.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOPROTOPREF")).split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
const uint cryptoFormats = stringListToCryptoMessageFormats(protocolPrefs);
int formats = 0;
if (cryptoFormats & InlineOpenPGPFormat) {
......
......@@ -154,7 +154,11 @@ void KolabBase::saveTo(KContacts::Addressee *addressee) const
{
addressee->setUid(uid());
addressee->setNote(body());
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
addressee->setCategories(categories().split(QLatin1Char(','), QString::SkipEmptyParts));
#else
addressee->setCategories(categories().split(QLatin1Char(','), Qt::SkipEmptyParts));
#endif
if (mTimeZone.isValid()) {
addressee->setRevision(lastModified().toTimeZone(mTimeZone));
}
......
......@@ -153,7 +153,11 @@ MessageStatus &KMIndexData::status()
QStringList KMIndexData::tagList() const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return mCachedStringParts[KMIndexReader::MsgTagPart].split(QLatin1Char(','), QString::SkipEmptyParts);
#else
return mCachedStringParts[KMIndexReader::MsgTagPart].split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
}
quint64 KMIndexData::uid() const
......
......@@ -109,7 +109,11 @@ private:
template<typename T>
static inline RemoteInformation loadImpl(const T &entity)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList parts = entity.remoteRevision().split(QLatin1Char(':'), QString::KeepEmptyParts);
#else
const QStringList parts = entity.remoteRevision().split(QLatin1Char(':'), Qt::KeepEmptyParts);
#endif
OXA::Folder::Module module = OXA::Folder::Unbound;
......@@ -170,9 +174,17 @@ public:
ObjectsLastSync()
{
if (!Settings::self()->objectsLastSync().isEmpty()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList pairs = Settings::self()->objectsLastSync().split(QLatin1Char(':'), QString::KeepEmptyParts);
#else
const QStringList pairs = Settings::self()->objectsLastSync().split(QLatin1Char(':'), Qt::KeepEmptyParts);
#endif
for (const QString &pair : pairs) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList entry = pair.split(QLatin1Char('='), QString::KeepEmptyParts);
#else
const QStringList entry = pair.split(QLatin1Char('='), Qt::KeepEmptyParts);
#endif
mObjectsMap.insert(entry.at(0).toLongLong(), entry.at(1).toULongLong());
}
}
......
......@@ -201,7 +201,11 @@ void FakeServer::setAllowedDeletions(const QString &deleteIds)
{
QMutexLocker locker(&mMutex);
mAllowedDeletions.clear();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList ids = deleteIds.split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList ids = deleteIds.split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (const QString &id : ids) {
mAllowedDeletions.append(id.toUtf8());
}
......@@ -211,7 +215,11 @@ void FakeServer::setAllowedRetrieves(const QString &retrieveIds)
{
QMutexLocker locker(&mMutex);
mAllowedRetrieves.clear();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList ids = retrieveIds.split(QLatin1Char(','), QString::SkipEmptyParts);
#else
const QStringList ids = retrieveIds.split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
for (const QString &id : ids) {
mAllowedRetrieves.append(id.toUtf8());
}
......@@ -232,7 +240,11 @@ void FakeServer::setNextConversation(const QString &conversation, const QList<in
Q_ASSERT(!conversation.isEmpty());
mGotDisconnected = false;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList lines = conversation.split(QStringLiteral("\r\n"), QString::SkipEmptyParts);
#else
QStringList lines = conversation.split(QStringLiteral("\r\n"), Qt::SkipEmptyParts);
#endif
Q_ASSERT(lines.first().startsWith(QLatin1String("C:")));
enum Mode {
......
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