Commit 432b82d2 authored by Patrick José Pereira's avatar Patrick José Pereira

QGCCameraControl: Do not use deprecated QString enum with Qt 5.15.0

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent dc20cf64
......@@ -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();
......
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