mirror of
https://github.com/leozide/leocad
synced 2025-02-05 08:45:55 +01:00
Don't show parent models in the All Parts category.
This commit is contained in:
parent
104f5c843e
commit
8060c30ba2
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue