Commit 47381a65 authored by Laurent Montel's avatar Laurent Montel 😁

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

parent 467acdb7
......@@ -149,7 +149,11 @@ void ComicArchiveJob::dataUpdated( const QString &source, const Plasma::DataEngi
const QString nextIdentifierSuffix = data[QStringLiteral("Next identifier suffix")].toString();
const QString firstIdentifierSuffix = data[QStringLiteral("First strip identifier suffix")].toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
mAuthors << data[QStringLiteral("Comic Author")].toString().split(QLatin1Char(','), QString::SkipEmptyParts);
#else
mAuthors << data[QStringLiteral("Comic Author")].toString().split(QLatin1Char(','), Qt::SkipEmptyParts);
#endif
mAuthors.removeDuplicates();
if ( mComicTitle.isEmpty() ) {
......
......@@ -197,7 +197,11 @@ void DiskQuota::quotaProcessFinished(int exitCode, QProcess::ExitStatus exitStat
const QString rawData = QString::fromLocal8Bit(m_quotaProcess->readAllStandardOutput());
// qDebug() << rawData;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList lines = rawData.split(QRegularExpression(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
#else
const QStringList lines = rawData.split(QRegularExpression(QStringLiteral("[\r\n]")), Qt::SkipEmptyParts);
#endif
// Testing
// QStringList lines = QStringList()
// << QStringLiteral("/home/peterpan 3975379* 5000000 7000000 57602 0 0")
......@@ -220,7 +224,11 @@ void DiskQuota::quotaProcessFinished(int exitCode, QProcess::ExitStatus exitStat
continue;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList parts = line.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList parts = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
// valid lines range from 7 to 9 parts (grace not always there):
// Disk quotas for user dh (uid 1000):
// Filesystem blocks quota limit grace files quota limit grace
......
......@@ -28,6 +28,6 @@ Timer::Timer(QObject *parent) : QObject(parent)
void Timer::runCommand(const QString &command)
{
QProcess::startDetached(command);
QProcess::startDetached(command, QStringList());
}
......@@ -207,7 +207,11 @@ void LocationListModel::addSources(const QMap<QString, QString> &sources)
while (it.hasNext()) {
it.next();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList list = it.value().split(QLatin1Char('|'), QString::SkipEmptyParts);
#else
const QStringList list = it.value().split(QLatin1Char('|'), Qt::SkipEmptyParts);
#endif
if (list.count() > 2) {
qDebug() << list;
m_locations.append(LocationItem(list[2], list[0], it.value()));
......
......@@ -95,7 +95,11 @@ bool ComicEngine::updateSourceEvent(const QString &identifier)
return true;
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList parts = identifier.split(QLatin1Char(':'), QString::KeepEmptyParts);
#else
const QStringList parts = identifier.split(QLatin1Char(':'), Qt::KeepEmptyParts);
#endif
// check whether it is cached, make sure second part present
if (parts.count() > 1 && CachedProvider::isCached(identifier)) {
......
......@@ -93,7 +93,11 @@ bool PotdEngine::updateSource( const QString &identifier, bool loadCachedAlways
}
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList parts = identifier.split( QLatin1Char( ':' ), QString::SkipEmptyParts );
#else
const QStringList parts = identifier.split( QLatin1Char( ':' ), Qt::SkipEmptyParts );
#endif
if (parts.empty()) {
qDebug() << "invalid identifier";
return false;
......
......@@ -261,7 +261,11 @@ void ConverterRunner::match(Plasma::RunnerContext &context)
double numberValue = 0.0;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const auto fractionParts = value.splitRef(QLatin1Char('/'), QString::SkipEmptyParts);
#else
const auto fractionParts = value.splitRef(QLatin1Char('/'), Qt::SkipEmptyParts);
#endif
if (fractionParts.isEmpty() || fractionParts.count() > 2) {
continue;
}
......
......@@ -54,7 +54,11 @@ void DictionaryRunner::match(Plasma::RunnerContext &context)
definitions.remove(QLatin1Char('\r')).remove(removeHtml);
while (definitions.contains(QLatin1String(" ")))
definitions.replace(QLatin1String(" "), QLatin1String(" "));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList lines = definitions.split(QLatin1Char('\n'), QString::SkipEmptyParts);
#else
QStringList lines = definitions.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
#endif
if (lines.length() < 2)
return;
lines.removeFirst();
......
......@@ -200,7 +200,11 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context)
QSharedPointer<Sonnet::Speller> speller = m_spellers[QString()];
if (speller->isValid()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList terms = query.split(QLatin1Char(' '), QString::SkipEmptyParts);
#else
QStringList terms = query.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
QString lang = findlang(terms);
//If we found a language, create a new speller object using it.
if (!lang.isEmpty()) {
......
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