diff --git a/server/rule.cpp b/server/rule.cpp index 03690af1..49bd1b5e 100644 --- a/server/rule.cpp +++ b/server/rule.cpp @@ -184,6 +184,12 @@ bool Rule::isConsistent() const return false; } + // check if this rules is based on any time events and contains exit actions + if (!timeDescriptor().timeEventItems().isEmpty() && !exitActions().isEmpty()) { + qCWarning(dcRuleEngine) << "Rule not consistent. The exitActions will never be executed if the rule contains an timeEvents."; + return false; + } + // check if there are any actions if (actions().isEmpty()) { qCWarning(dcRuleEngine) << "Rule not consistent. A rule without actions has no effect."; diff --git a/tests/auto/timemanager/testtimemanager.cpp b/tests/auto/timemanager/testtimemanager.cpp index 8a662c35..a81928dd 100644 --- a/tests/auto/timemanager/testtimemanager.cpp +++ b/tests/auto/timemanager/testtimemanager.cpp @@ -344,7 +344,6 @@ void TestTimeManager::addTimeDescriptor_data() QTest::newRow("invalid: timeEventItem - invalid weekdays (to big)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidWeekDays2)) << RuleEngine::RuleErrorInvalidRepeatingOption; QTest::newRow("invalid: timeEventItem - invalid monthdays (negative)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidMonthDays)) << RuleEngine::RuleErrorInvalidRepeatingOption; QTest::newRow("invalid: timeEventItem - invalid monthdays (to big)") << createTimeDescriptorTimeEvent(createTimeEventItem("13:13", repeatingOptionInvalidMonthDays2)) << RuleEngine::RuleErrorInvalidRepeatingOption; - } void TestTimeManager::addTimeDescriptor()