summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index a9ff6463..805e77f4 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -36,10 +36,9 @@ using namespace MOBase;
ModListSortProxy::ModListSortProxy(Profile* profile, QObject *parent)
: QSortFilterProxyModel(parent)
, m_Profile(profile)
- , m_CategoryFilter()
- , m_CurrentFilter()
, m_FilterActive(false)
, m_FilterMode(FILTER_AND)
+ , m_FilterNot(false)
{
setDynamicSortFilter(true); // this seems to work without dynamicsortfilter
// but I don't know why. This should be necessary
@@ -312,8 +311,8 @@ bool ModListSortProxy::filterMatchesModAnd(ModInfo::Ptr info, bool enabled) cons
if (!info->hasFlag(ModInfo::FLAG_INVALID)) return false;
} break;
case CategoryFactory::CATEGORY_SPECIAL_NONEXUSID: {
- if (!(info->getNexusID() == -1 && !info->hasFlag(ModInfo::FLAG_FOREIGN) &&
- !info->hasFlag(ModInfo::FLAG_BACKUP) &&
+ if (!(info->getNexusID() == -1 && !info->hasFlag(ModInfo::FLAG_FOREIGN) &&
+ !info->hasFlag(ModInfo::FLAG_BACKUP) &&
!info->hasFlag(ModInfo::FLAG_SEPARATOR) &&
!info->hasFlag(ModInfo::FLAG_OVERWRITE))) return false;
} break;
@@ -381,7 +380,7 @@ bool ModListSortProxy::filterMatchesModOr(ModInfo::Ptr info, bool enabled) const
if (info->hasContent(static_cast<ModInfo::EContent>(content))) return true;
}
- return false;
+ return m_CategoryFilter.empty() && m_ContentFilter.empty();
}
bool ModListSortProxy::filterMatchesMod(ModInfo::Ptr info, bool enabled) const
@@ -487,6 +486,14 @@ void ModListSortProxy::setFilterMode(ModListSortProxy::FilterMode mode)
}
}
+void ModListSortProxy::setFilterNot(bool b)
+{
+ if (b != m_FilterNot) {
+ m_FilterNot = b;
+ this->invalidate();
+ }
+}
+
bool ModListSortProxy::filterAcceptsRow(int row, const QModelIndex &parent) const
{
if (m_Profile == nullptr) {