From 432b82d26ec49e94f87759b5574692fc0bec8861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jun 2020 12:44:36 -0300 Subject: [PATCH] QGCCameraControl: Do not use deprecated QString enum with Qt 5.15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/Camera/QGCCameraControl.cc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Camera/QGCCameraControl.cc b/src/Camera/QGCCameraControl.cc index 4928d527a..3a5d8a5cf 100644 --- a/src/Camera/QGCCameraControl.cc +++ b/src/Camera/QGCCameraControl.cc @@ -1274,17 +1274,26 @@ QGCCameraControl::_processConditionTest(const QString conditionTest) qCDebug(CameraControlVerboseLog) << "_processConditionTest(" << conditionTest << ")"; int op = TEST_NONE; QStringList test; + + auto split = [&conditionTest](const QString& sep ) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + return conditionTest.split(sep, QString::SkipEmptyParts); +#else + return conditionTest.split(sep, Qt::SkipEmptyParts); +#endif + }; + if(conditionTest.contains("!=")) { - test = conditionTest.split("!=", QString::SkipEmptyParts); + test = split("!="); op = TEST_NOT_EQUAL; } else if(conditionTest.contains("=")) { - test = conditionTest.split("=", QString::SkipEmptyParts); + test = split("="); op = TEST_EQUAL; } else if(conditionTest.contains(">")) { - test = conditionTest.split(">", QString::SkipEmptyParts); + test = split(">"); op = TEST_GREATER; } else if(conditionTest.contains("<")) { - test = conditionTest.split("<", QString::SkipEmptyParts); + test = split("<"); op = TEST_SMALLER; } if(test.size() == 2) { @@ -1319,7 +1328,11 @@ QGCCameraControl::_processCondition(const QString condition) bool result = true; bool andOp = true; if(!condition.isEmpty()) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) QStringList scond = condition.split(" ", QString::SkipEmptyParts); +#else + QStringList scond = condition.split(" ", Qt::SkipEmptyParts); +#endif while(scond.size()) { QString test = scond.first(); scond.removeFirst(); -- 2.22.0