From ae445606e26020225e50d71e8ffd5282f68a9961 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Fri, 26 Sep 2025 18:19:53 +0200 Subject: config: allow negative to be used with tags. (#11779) --- src/helpers/TagKeeper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/helpers/TagKeeper.cpp b/src/helpers/TagKeeper.cpp index f960accb..3c7071d5 100644 --- a/src/helpers/TagKeeper.cpp +++ b/src/helpers/TagKeeper.cpp @@ -1,7 +1,10 @@ #include "TagKeeper.hpp" bool CTagKeeper::isTagged(const std::string& tag, bool strict) { - return m_tags.contains(tag) || (!strict && m_tags.contains(tag + "*")); + const bool NEGATIVE = tag.starts_with("negative"); + const auto MATCH = NEGATIVE ? tag.substr(9) : tag; + const bool TAGGED = m_tags.contains(MATCH) || (!strict && m_tags.contains(MATCH + "*")); + return NEGATIVE ? !TAGGED : TAGGED; } bool CTagKeeper::applyTag(const std::string& tag, bool dynamic) { -- cgit v1.2.3