CResourceProxyModel: Pass type filters by const

These aren't modified.
This commit is contained in:
Lioncache
2025-12-12 12:32:13 -05:00
parent e7812fb1e4
commit 798d6e61dd
2 changed files with 5 additions and 5 deletions

View File

@@ -103,7 +103,7 @@ bool CResourceProxyModel::filterAcceptsRow(int SourceRow, const QModelIndex& rkS
return true; return true;
} }
void CResourceProxyModel::SetTypeFilter(CResTypeInfo *pInfo, bool Allow) void CResourceProxyModel::SetTypeFilter(const CResTypeInfo *pInfo, bool Allow)
{ {
if (Allow) if (Allow)
mTypeFilter.insert(pInfo); mTypeFilter.insert(pInfo);
@@ -111,7 +111,7 @@ void CResourceProxyModel::SetTypeFilter(CResTypeInfo *pInfo, bool Allow)
mTypeFilter.remove(pInfo); mTypeFilter.remove(pInfo);
} }
bool CResourceProxyModel::IsTypeAccepted(CResTypeInfo* pTypeInfo) const bool CResourceProxyModel::IsTypeAccepted(const CResTypeInfo* pTypeInfo) const
{ {
return mTypeFilter.isEmpty() || mTypeFilter.contains(pTypeInfo); return mTypeFilter.isEmpty() || mTypeFilter.contains(pTypeInfo);
} }

View File

@@ -25,10 +25,10 @@ public:
bool lessThan(const QModelIndex& rkLeft, const QModelIndex& rkRight) const override; bool lessThan(const QModelIndex& rkLeft, const QModelIndex& rkRight) const override;
bool filterAcceptsRow(int SourceRow, const QModelIndex& rkSourceParent) const override; bool filterAcceptsRow(int SourceRow, const QModelIndex& rkSourceParent) const override;
void SetTypeFilter(CResTypeInfo *pInfo, bool Allow); void SetTypeFilter(const CResTypeInfo *pInfo, bool Allow);
void ClearTypeFilter() { mTypeFilter.clear(); } void ClearTypeFilter() { mTypeFilter.clear(); }
bool HasTypeFilter() const { return !mTypeFilter.isEmpty(); } bool HasTypeFilter() const { return !mTypeFilter.isEmpty(); }
bool IsTypeAccepted(CResTypeInfo* pTypeInfo) const; bool IsTypeAccepted(const CResTypeInfo* pTypeInfo) const;
void SetSortMode(ESortMode Mode); void SetSortMode(ESortMode Mode);
@@ -39,7 +39,7 @@ private:
CResourceTableModel *mpModel = nullptr; CResourceTableModel *mpModel = nullptr;
TString mSearchString; TString mSearchString;
ESortMode mSortMode{}; ESortMode mSortMode{};
QSet<CResTypeInfo*> mTypeFilter; QSet<const CResTypeInfo*> mTypeFilter;
uint64_t mCompareID = 0; uint64_t mCompareID = 0;
uint64_t mCompareMask = 0; uint64_t mCompareMask = 0;