From 6aee6f857efede3f62210b0b53404f96adebd1f7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 6 May 2024 11:27:36 +0100 Subject: [PATCH] Don't leak output file path between projects. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17846 (cherry picked from commit 0e9b547f948b2754eeeec37e5efd918454387ed7) --- pcbnew/dialogs/dialog_gen_footprint_position.cpp | 5 +---- pcbnew/pcbnew_settings.cpp | 8 ++++++-- pcbnew/pcbnew_settings.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pcbnew/dialogs/dialog_gen_footprint_position.cpp b/pcbnew/dialogs/dialog_gen_footprint_position.cpp index 6f45f20a60..557407128d 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position.cpp +++ b/pcbnew/dialogs/dialog_gen_footprint_position.cpp @@ -178,10 +178,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 ); diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 42184d9c15..e37b0ac68e 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -485,8 +485,12 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "netlist.associate_by_ref_sch", &m_NetlistDialog.associate_by_ref_sch, false ) ); - m_params.emplace_back( new PARAM( "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( "place_file.output_directory", + * &m_PlaceFile.output_directory, wxEmptyString ) ); + */ m_params.emplace_back( new PARAM( "place_file.units", &m_PlaceFile.units, 1 ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 5a263b6858..138ac1e2e8 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -267,7 +267,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;