Commit 86f897f1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without deprecated method against qt5.15

parent a974e9d1
...@@ -96,7 +96,7 @@ endif() ...@@ -96,7 +96,7 @@ endif()
add_definitions(-DTRANSLATION_DOMAIN=\"kitinerary\") add_definitions(-DTRANSLATION_DOMAIN=\"kitinerary\")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
endif() endif()
......
...@@ -176,7 +176,12 @@ int main(int argc, char** argv) ...@@ -176,7 +176,12 @@ int main(int argc, char** argv)
engine.setContextDate(contextDt); engine.setContextDate(contextDt);
if (!parser.value(extOpt).isEmpty()) { if (!parser.value(extOpt).isEmpty()) {
const auto extNames = parser.value(extOpt).split(QLatin1Char(';'), QString::SkipEmptyParts); const auto extNames = parser.value(extOpt).split(QLatin1Char(';'),
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QString::SkipEmptyParts);
#else
Qt::SkipEmptyParts);
#endif
std::vector<Extractor> exts; std::vector<Extractor> exts;
exts.reserve(extNames.size()); exts.reserve(extNames.size());
for (const auto &name : extNames) { for (const auto &name : extNames) {
......
...@@ -204,7 +204,12 @@ static void iataCodeForNameFragments(const QStringList &fragments, std::vector<I ...@@ -204,7 +204,12 @@ static void iataCodeForNameFragments(const QStringList &fragments, std::vector<I
static QStringList splitToFragments(const QString &name) static QStringList splitToFragments(const QString &name)
{ {
return name.split(QRegularExpression(QStringLiteral("[ 0-9/'\"\\(\\)&\\,.–„-]")), QString::SkipEmptyParts); return name.split(QRegularExpression(QStringLiteral("[ 0-9/'\"\\(\\)&\\,.–„-]")),
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QString::SkipEmptyParts);
#else
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