From 1d832fad847a0538e17a393993d633e99bd90709 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 7 Oct 2017 18:02:51 +0200 Subject: [PATCH] make sure rule statesActive is properly initialized --- libguh-core/ruleengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libguh-core/ruleengine.cpp b/libguh-core/ruleengine.cpp index 1ede58cd..65c586d1 100644 --- a/libguh-core/ruleengine.cpp +++ b/libguh-core/ruleengine.cpp @@ -1070,7 +1070,9 @@ QVariant::Type RuleEngine::getEventParamType(const EventTypeId &eventTypeId, con void RuleEngine::appendRule(const Rule &rule) { - m_rules.insert(rule.id(), rule); + Rule newRule = rule; + newRule.setStatesActive(newRule.stateEvaluator().evaluate()); + m_rules.insert(rule.id(), newRule); m_ruleIds.append(rule.id()); }