diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-27 17:05:20 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-27 17:05:20 -0500 |
| commit | d5e38fca6b3a8c7bf90c5a3d8ec779752a22c61d (patch) | |
| tree | 739a30efabfb7c3777f9781c8a735f4e53bec02d /src/modlistsortproxy.cpp | |
| parent | fb3c15094fded829b120274189b0b331a68b2afa (diff) | |
added not filter, not functional yet
fixed no mods being displayed for OR with no conditions
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 17 |
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) {
|
