Prefer relative paths.
This also prevents us from leaking private information into netlists and PCBNew files. Fixes https://gitlab.com/kicad/code/kicad/issues/6361
This commit is contained in:
parent
6654c03041
commit
4e8072b8c2
|
@ -432,7 +432,11 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
|
||||||
{
|
{
|
||||||
// Clean up any allocated memory if an exception occurs loading the schematic.
|
// Clean up any allocated memory if an exception occurs loading the schematic.
|
||||||
std::unique_ptr<SCH_SHEET> newSheet = std::make_unique<SCH_SHEET>( aSchematic );
|
std::unique_ptr<SCH_SHEET> newSheet = std::make_unique<SCH_SHEET>( aSchematic );
|
||||||
newSheet->SetFileName( aFileName );
|
|
||||||
|
wxFileName relPath( aFileName );
|
||||||
|
relPath.MakeRelativeTo( aSchematic->Prj().GetProjectPath(), wxPATH_UNIX );
|
||||||
|
|
||||||
|
newSheet->SetFileName( relPath.GetFullPath() );
|
||||||
m_rootSheet = newSheet.get();
|
m_rootSheet = newSheet.get();
|
||||||
loadHierarchy( newSheet.get() );
|
loadHierarchy( newSheet.get() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue