From 798d6e61ddb0688eb7f9b7c303e877b5e9fac0d8 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Fri, 12 Dec 2025 12:32:13 -0500 Subject: [PATCH] CResourceProxyModel: Pass type filters by const These aren't modified. --- src/Editor/ResourceBrowser/CResourceProxyModel.cpp | 4 ++-- src/Editor/ResourceBrowser/CResourceProxyModel.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Editor/ResourceBrowser/CResourceProxyModel.cpp b/src/Editor/ResourceBrowser/CResourceProxyModel.cpp index 798608e9..b22d7fce 100644 --- a/src/Editor/ResourceBrowser/CResourceProxyModel.cpp +++ b/src/Editor/ResourceBrowser/CResourceProxyModel.cpp @@ -103,7 +103,7 @@ bool CResourceProxyModel::filterAcceptsRow(int SourceRow, const QModelIndex& rkS return true; } -void CResourceProxyModel::SetTypeFilter(CResTypeInfo *pInfo, bool Allow) +void CResourceProxyModel::SetTypeFilter(const CResTypeInfo *pInfo, bool Allow) { if (Allow) mTypeFilter.insert(pInfo); @@ -111,7 +111,7 @@ void CResourceProxyModel::SetTypeFilter(CResTypeInfo *pInfo, bool Allow) mTypeFilter.remove(pInfo); } -bool CResourceProxyModel::IsTypeAccepted(CResTypeInfo* pTypeInfo) const +bool CResourceProxyModel::IsTypeAccepted(const CResTypeInfo* pTypeInfo) const { return mTypeFilter.isEmpty() || mTypeFilter.contains(pTypeInfo); } diff --git a/src/Editor/ResourceBrowser/CResourceProxyModel.h b/src/Editor/ResourceBrowser/CResourceProxyModel.h index 9da9e23b..d1626149 100644 --- a/src/Editor/ResourceBrowser/CResourceProxyModel.h +++ b/src/Editor/ResourceBrowser/CResourceProxyModel.h @@ -25,10 +25,10 @@ public: bool lessThan(const QModelIndex& rkLeft, const QModelIndex& rkRight) 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(); } bool HasTypeFilter() const { return !mTypeFilter.isEmpty(); } - bool IsTypeAccepted(CResTypeInfo* pTypeInfo) const; + bool IsTypeAccepted(const CResTypeInfo* pTypeInfo) const; void SetSortMode(ESortMode Mode); @@ -39,7 +39,7 @@ private: CResourceTableModel *mpModel = nullptr; TString mSearchString; ESortMode mSortMode{}; - QSet mTypeFilter; + QSet mTypeFilter; uint64_t mCompareID = 0; uint64_t mCompareMask = 0;