mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 18:48:32 +02:00
Fixing filters creation
This commit is contained in:
parent
a124d3b433
commit
f0edc302bf
1 changed files with 6 additions and 1 deletions
|
@ -845,10 +845,15 @@ Route::Pointer UserInputMapper::parseRoute(const QJsonValue& value) {
|
|||
}
|
||||
|
||||
const auto& filtersValue = obj[JSON_CHANNEL_FILTERS];
|
||||
// FIXME support strings for filters with no parameters, both in the array and at the top level...
|
||||
// i.e.
|
||||
// { "from": "Standard.DU", "to" : "Actions.LONGITUDINAL_FORWARD", "filters" : "invert" },
|
||||
// and
|
||||
// { "from": "Standard.DU", "to" : "Actions.LONGITUDINAL_FORWARD", "filters" : [ "invert", "constrainToInteger" ] },
|
||||
if (filtersValue.isArray()) {
|
||||
auto filtersArray = filtersValue.toArray();
|
||||
for (auto filterValue : filtersArray) {
|
||||
if (filterValue.isObject()) {
|
||||
if (!filterValue.isObject()) {
|
||||
qWarning() << "Invalid filter " << filterValue;
|
||||
return Route::Pointer();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue