Cleanup PathHumanReadable and remove dead code

Fixes https://gitlab.com/kicad/code/kicad/issues/6152
This commit is contained in:
Michael Kavanagh 2020-10-25 17:00:42 +00:00 committed by Jeff Young
parent 55c25f3cc4
commit 644546cd83
4 changed files with 5 additions and 24 deletions

View File

@ -768,7 +768,7 @@ void DIALOG_SHEET_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
// Propagate changes in sheetname to displayed hierarchical path
wxString hierarchicalPath = _( "Hierarchical path: " );
hierarchicalPath += m_frame->GetCurrentSheet().PathHumanReadable( false );
hierarchicalPath += m_frame->GetCurrentSheet().PathHumanReadable();
if( hierarchicalPath.Last() != '/' )
hierarchicalPath.Append( '/' );

View File

@ -712,7 +712,7 @@ void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList
SCH_SHEET_PATH path = schframe->GetCurrentSheet();
path.push_back( this );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable( false ), BLUE );
aList.emplace_back( _( "Hierarchical Path" ), path.PathHumanReadable(), BLUE );
}
aList.emplace_back( _( "File Name" ), m_fields[ SHEETFILENAME ].GetText(), BROWN );

View File

@ -224,24 +224,11 @@ KIID_PATH SCH_SHEET_PATH::PathWithoutRootUuid() const
}
wxString SCH_SHEET_PATH::GetRootPathName( bool aUseShortName )
{
// return a PathName for the root sheet (like "/" or "<root>"
// DO NOT use it in netlists, because it can easily break these netlists
// especially after translation, because many netlists (i.e. spice) do not accept any char
// Use only the short name ("/") and the full name only in messages
return aUseShortName ? wxT( "/" ) : _( "<root_sheet>" );
}
wxString SCH_SHEET_PATH::PathHumanReadable( bool aUseShortRootName ) const
wxString SCH_SHEET_PATH::PathHumanReadable() const
{
wxString s;
if( aUseShortRootName )
s = GetRootPathName( true ); // Use only the short name in netlists
else
s = GetRootPathName( false ) + wxT( "/" );
s = wxT( "/" );
// Start at 1 since we've already processed the root sheet.
for( unsigned i = 1; i < size(); i++ )

View File

@ -273,13 +273,7 @@ public:
* The the "normal" path instead uses the #KIID objects in the path that do not change
* even when editing sheet parameters.
*/
wxString PathHumanReadable( bool aUseShortRootName = true ) const;
/**
* @return a path name for the root sheet (like "/" or "<root>"
* @param aUseShortName: true to return "/", false to return a longer name
*/
static wxString GetRootPathName( bool aUseShortName = true );
wxString PathHumanReadable() const;
/**
* Update all the symbol references for this sheet path.