Don't show parent models in the All Parts category.

This commit is contained in:
Leonardo 2017-12-21 14:12:01 -08:00
parent 104f5c843e
commit 8060c30ba2

View file

@ -127,8 +127,22 @@ void lcPartSelectionListModel::SetCategory(int CategoryIndex)
if (CategoryIndex != -1)
Library->GetCategoryEntries(CategoryIndex, false, SingleParts, GroupedParts);
else
{
Library->GetParts(SingleParts);
lcModel* CurrentModel = lcGetActiveModel();
for (int PartIdx = 0; PartIdx < SingleParts.GetSize(); )
{
PieceInfo* Info = SingleParts[PartIdx];
if (!Info->IsModel() || !Info->GetModel()->IncludesModel(CurrentModel))
PartIdx++;
else
SingleParts.RemoveIndex(PartIdx);
}
}
auto lcPartSortFunc=[](PieceInfo* const& a, PieceInfo* const& b)
{
return strcmp(a->m_strDescription, b->m_strDescription);