diff options
| author | ItsOhen <TNordfeldt@gmail.com> | 2025-09-26 18:19:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-26 18:19:53 +0200 |
| commit | ae445606e26020225e50d71e8ffd5282f68a9961 (patch) | |
| tree | 704bb76e883ff832bb740f306def2b3bbe965c50 /src | |
| parent | 4f3dd1ddb44c0798a7c1c9485b179b36304de098 (diff) | |
config: allow negative to be used with tags. (#11779)
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/TagKeeper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |
