From 97886cf0dab39ce4b7887e549b93ccec30156ddc Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 28 Apr 2026 15:55:41 +0100 Subject: desktop/rule: cleanup inheritance, use templates to avoid dup --- src/desktop/rule/Rule.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/desktop/rule/Rule.cpp') diff --git a/src/desktop/rule/Rule.cpp b/src/desktop/rule/Rule.cpp index 5e3141cd..cfc1edf3 100644 --- a/src/desktop/rule/Rule.cpp +++ b/src/desktop/rule/Rule.cpp @@ -104,10 +104,22 @@ std::underlying_type_t IRule::getPropertiesMask() { return m_mask; } +void IRule::setEnabled(bool enable) { + m_enabled = enable; +} + +bool IRule::isEnabled() const { + return m_enabled; +} + bool IRule::has(eRuleProperty p) { return m_matchEngines.contains(p); } +bool IRule::canMatch() const { + return !m_matchEngines.empty() && m_enabled; +} + bool IRule::matches(eRuleProperty p, const std::string& s) { if (!has(p)) return false; -- cgit v1.2.3