From ed14d5510d932362f8e232496b824729e096d3cf Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 30 Nov 2019 02:20:18 -0500 Subject: implemented not flag moved stuff to CriteriaItem fixed jumbled names in getSpecialCategoryName() --- src/modlistsortproxy.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 646401b9..3bb02c0f 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -305,18 +305,35 @@ bool ModListSortProxy::filterMatchesModOr(ModInfo::Ptr info, bool enabled) const bool ModListSortProxy::criteriaMatchesMod( ModInfo::Ptr info, bool enabled, const Criteria& c) const { + bool b = false; + switch (c.type) { case TYPE_SPECIAL: // fall-through case TYPE_CATEGORY: - return categoryMatchesMod(info, enabled, c.id); + { + b = categoryMatchesMod(info, enabled, c.id); + break; + } case TYPE_CONTENT: - return contentMatchesMod(info, enabled, c.id); + { + b = contentMatchesMod(info, enabled, c.id); + break; + } default: - return false; + { + log::error("bad criteria type {}", c.type); + break; + } } + + if (c.inverse) { + b = !b; + } + + return b; } bool ModListSortProxy::categoryMatchesMod( -- cgit v1.3.1