mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 10:49:23 +00:00
CResourceProxyModel: Pass type filters by const
These aren't modified.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user