Don't leak output file path between projects.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17846
This commit is contained in:
Jeff Young 2024-05-06 11:27:36 +01:00
parent 39835fe82a
commit 0e9b547f94
3 changed files with 8 additions and 7 deletions

View File

@ -179,10 +179,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::initDialog()
m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCHES : EDA_UNITS::MILLIMETRES;
// Output directory
if( !projectFile.m_PcbLastPath[ LAST_PATH_POS_FILES ].IsEmpty() )
m_outputDirectoryName->SetValue( projectFile.m_PcbLastPath[ LAST_PATH_POS_FILES ] );
else
m_outputDirectoryName->SetValue( cfg->m_PlaceFile.output_directory );
m_outputDirectoryName->SetValue( projectFile.m_PcbLastPath[ LAST_PATH_POS_FILES ] );
// Update Options
m_radioBoxUnits->SetSelection( cfg->m_PlaceFile.units );

View File

@ -497,8 +497,12 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back( new PARAM<bool>( "netlist.associate_by_ref_sch",
&m_NetlistDialog.associate_by_ref_sch, false ) );
m_params.emplace_back( new PARAM<wxString>( "place_file.output_directory",
&m_PlaceFile.output_directory, wxEmptyString ) );
/*
* place_file.output_directory is only used at run-time; actual data is in project file
*
* m_params.emplace_back( new PARAM<wxString>( "place_file.output_directory",
* &m_PlaceFile.output_directory, wxEmptyString ) );
*/
m_params.emplace_back( new PARAM<int>( "place_file.units",
&m_PlaceFile.units, 1 ) );

View File

@ -271,7 +271,7 @@ public:
struct DIALOG_PLACE_FILE
{
wxString output_directory; // legacy; now in project settings
wxString output_directory; // only used at run-time; actual data in project settings
int units;
int file_options;
int file_format;