From cb422e29dfa4e3cf6783a0ad120195775a3de63c Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 8 Dec 2017 05:53:53 -0800 Subject: [PATCH] Eeschema: Filter out empty libraries Fixes: lp:1736930 * https://bugs.launchpad.net/kicad/+bug/1736930 --- eeschema/cmp_tree_model_adapter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eeschema/cmp_tree_model_adapter.cpp b/eeschema/cmp_tree_model_adapter.cpp index 01c973564c..6055674a84 100644 --- a/eeschema/cmp_tree_model_adapter.cpp +++ b/eeschema/cmp_tree_model_adapter.cpp @@ -60,9 +60,11 @@ void CMP_TREE_MODEL_ADAPTER::AddLibrary( wxString const& aLibNickname ) return; } - AddAliasList( aLibNickname, aliases ); - - m_tree.AssignIntrinsicRanks(); + if( aliases.size() > 0 ) + { + AddAliasList( aLibNickname, aliases ); + m_tree.AssignIntrinsicRanks(); + } } @@ -91,5 +93,6 @@ void CMP_TREE_MODEL_ADAPTER::AddAliasList( alias_list.push_back( a ); } - AddAliasList( aNodeName, alias_list ); + if( alias_list.size() > 0 ) + AddAliasList( aNodeName, alias_list ); }