From 713a296a59564f44f86cbe39b720de2e0698de60 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 19 Aug 2019 10:47:28 +0100 Subject: [PATCH] Update all aliases of current node after Symbol Properties dialog. Fixes: lp:1840466 * https://bugs.launchpad.net/kicad/+bug/1840466 --- eeschema/libedit/lib_edit_frame.cpp | 12 ++++++++++++ eeschema/symbol_tree_synchronizing_adapter.cpp | 17 +---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 26990d29f3..948a8d7ab5 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -1084,7 +1084,19 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event ) m_libMgr->UpdatePart( GetCurPart(), GetCurLib() ); if( oldAliases != GetCurPart()->GetAliasNames( false ) ) + { + // If the number of aliases (or their names) have changed, do a full re-sync SyncLibraries( false ); + } + else + { + // Otherwise just update each alias + for( LIB_ALIAS* alias : GetCurPart()->GetAliases() ) + { + wxDataViewItem item = m_libMgr->GetAdapter()->FindItem( alias->GetLibId() ); + static_cast( item.GetID() )->Update( alias ); + } + } } UpdatePartSelectList(); diff --git a/eeschema/symbol_tree_synchronizing_adapter.cpp b/eeschema/symbol_tree_synchronizing_adapter.cpp index cef3742b48..10fe46bd10 100644 --- a/eeschema/symbol_tree_synchronizing_adapter.cpp +++ b/eeschema/symbol_tree_synchronizing_adapter.cpp @@ -232,22 +232,7 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie break; case 1: - if( node->LibId == m_libMgr->GetCurrentLibId() ) - { - LIB_ALIAS* alias = nullptr; - - // When the node parent name is empty, the node is a lib name, not a symbol name - // However should not happen, but happens. - if( !node->Parent->Name.IsEmpty() ) - alias = m_libMgr->GetAlias( node->Name, node->Parent->Name ); - - if( alias ) - aVariant = alias->GetDescription(); - else - aVariant = node->Desc; - } - else - aVariant = node->Desc; + aVariant = node->Desc; break; default: // column == -1 is used for default Compare function