From 670fc645de53329be9d0cf33495713cf0a6ae99f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 6 Nov 2020 01:32:40 +0000 Subject: [PATCH] More fixes for initializing imported filenames. --- eeschema/sch_plugins/altium/sch_altium_plugin.cpp | 2 +- eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index 1a94e87aaf..3d8259f92b 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -171,7 +171,7 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchem else { m_rootSheet = new SCH_SHEET( aSchematic ); - m_rootSheet->SetFileName( aFileName ); + m_rootSheet->SetFileName( fileName.GetFullPath() ); } if( !m_rootSheet->GetScreen() ) diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index b56d06cd6b..8eb4df1732 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -413,6 +413,9 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema // Delete on exception, if I own m_rootSheet, according to aAppendToMe unique_ptr deleter( aAppendToMe ? nullptr : m_rootSheet ); + wxFileName newFilename( m_filename ); + newFilename.SetExt( "kicad_sch" ); + if( aAppendToMe ) { wxCHECK_MSG( aSchematic->IsValid(), nullptr, "Can't append to a schematic with no root!" ); @@ -421,13 +424,13 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema else { m_rootSheet = new SCH_SHEET( aSchematic ); - m_rootSheet->SetFileName( aFileName ); + m_rootSheet->SetFileName( newFilename.GetFullPath() ); } if( !m_rootSheet->GetScreen() ) { SCH_SCREEN* screen = new SCH_SCREEN( m_schematic ); - screen->SetFileName( aFileName ); + screen->SetFileName( newFilename.GetFullPath() ); m_rootSheet->SetScreen( screen ); }