mirror of
https://github.com/leozide/leocad
synced 2025-02-13 20:47:49 +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)
|
if (CategoryIndex != -1)
|
||||||
Library->GetCategoryEntries(CategoryIndex, false, SingleParts, GroupedParts);
|
Library->GetCategoryEntries(CategoryIndex, false, SingleParts, GroupedParts);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Library->GetParts(SingleParts);
|
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)
|
auto lcPartSortFunc=[](PieceInfo* const& a, PieceInfo* const& b)
|
||||||
{
|
{
|
||||||
return strcmp(a->m_strDescription, b->m_strDescription);
|
return strcmp(a->m_strDescription, b->m_strDescription);
|
||||||
|
|
Loading…
Add table
Reference in a new issue