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

Make it compile against qt5.15

parent b02f8ea7
......@@ -99,7 +99,11 @@ Term Query::term() const
void Query::addType(const QString &type)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
d->m_types << type.split(QLatin1Char('/'), QString::SkipEmptyParts);
#else
d->m_types << type.split(QLatin1Char('/'), Qt::SkipEmptyParts);
#endif
}
void Query::addTypes(const QStringList &typeList)
......
......@@ -321,7 +321,11 @@ ResultIterator EmailQuery::exec()
parser.set_database(db);
parser.set_default_op(Xapian::Query::OP_AND);
if (d->splitSearchMatchString) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList list = d->matchString.split(QRegularExpression(QStringLiteral("\\s")), QString::SkipEmptyParts);
#else
const QStringList list = d->matchString.split(QRegularExpression(QStringLiteral("\\s")), Qt::SkipEmptyParts);
#endif
for (const QString &s : list) {
const QByteArray ba = s.toUtf8();
m_queries << parser.parse_query(ba.constData(),
......
......@@ -196,7 +196,11 @@ Xapian::Query XapianQueryParser::parseQuery(const QString &text, const QString &
}
str = cleanString.normalized(QString::NormalizationForm_KC);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList lst = str.split(QLatin1Char('_'), QString::SkipEmptyParts);
#else
const QStringList lst = str.split(QLatin1Char('_'), Qt::SkipEmptyParts);
#endif
for (const QString &t : lst) {
const QString term = prefix + t;
......
......@@ -76,7 +76,11 @@ QStringList XapianTermGenerator::termList(const QString &text)
}
str = cleanString.normalized(QString::NormalizationForm_KC);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
list << str.split(QLatin1Char('_'), QString::SkipEmptyParts);
#else
list << str.split(QLatin1Char('_'), Qt::SkipEmptyParts);
#endif
}
}
......
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