Fix eventdescriptor params in edit rule page
This commit is contained in:
parent
bef59fbdd7
commit
3d9e0904da
@ -54,7 +54,7 @@ EventType *EventTypes::getEventType(const QUuid &eventTypeId) const
|
||||
return eventType;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int EventTypes::rowCount(const QModelIndex &parent) const
|
||||
|
||||
@ -81,9 +81,9 @@ NymeaSwipeDelegate {
|
||||
operatorString = " ? ";
|
||||
}
|
||||
|
||||
var paramType = paramDescriptor.paramTypeId
|
||||
? root.eventType.paramTypes.getParamType(paramDescriptor.paramTypeId)
|
||||
: root.eventType.paramTypes.findByName(paramDescriptor.paramName)
|
||||
var paramType = paramDescriptor.paramName
|
||||
? root.eventType.paramTypes.findByName(paramDescriptor.paramName)
|
||||
: root.eventType.paramTypes.getParamType(paramDescriptor.paramTypeId)
|
||||
|
||||
if (i === 0) {
|
||||
// TRANSLATORS: example: "only if temperature > 5"
|
||||
|
||||
@ -391,6 +391,7 @@ Page {
|
||||
// has the template a value for this? If so, set it, otherwise flag as needsParams
|
||||
print("template:", paramType.id, eventDescriptorTemplate.paramDescriptors.count)
|
||||
if (paramDescriptorTemplate && paramDescriptorTemplate.value !== undefined) {
|
||||
print("filling in param descriptor:", paramDescriptorTemplate.value)
|
||||
eventDescriptor.paramDescriptors.setParamDescriptorByName(paramDescriptorTemplate.paramName, paramDescriptorTemplate.value, paramDescriptorTemplate.operatorType);
|
||||
} else {
|
||||
needsParams = true;
|
||||
|
||||
@ -94,6 +94,7 @@ Page {
|
||||
for (var i = 0; i < delegateRepeater.count; i++) {
|
||||
var paramDelegate = delegateRepeater.itemAt(i);
|
||||
if (paramDelegate.considerParam) {
|
||||
print("adding param descriptor")
|
||||
if (root.device) {
|
||||
root.eventDescriptor.paramDescriptors.setParamDescriptor(paramDelegate.paramType.id, paramDelegate.value, paramDelegate.operatorType)
|
||||
} else if (root.iface) {
|
||||
|
||||
Reference in New Issue
Block a user