7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 08:31:40 +00:00

Don't smash the preferences while loading previous job sets

This commit is contained in:
JamesJCode 2025-01-03 00:30:24 +00:00
parent 2eea14ea58
commit e13b31fd42
2 changed files with 7 additions and 4 deletions

View File

@ -731,7 +731,8 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave )
}
void KICAD_MANAGER_FRAME::OpenJobsFile( const wxFileName& aFileName, bool aCreate )
void KICAD_MANAGER_FRAME::OpenJobsFile( const wxFileName& aFileName, bool aCreate,
bool aResaveProjectPreferences )
{
if( !ADVANCED_CFG::GetCfg().m_EnableJobset )
{
@ -762,7 +763,8 @@ void KICAD_MANAGER_FRAME::OpenJobsFile( const wxFileName& aFileName, bool aCreat
jobPanel->SetClosable( true );
m_notebook->AddPage( jobPanel, aFileName.GetFullName(), true );
SaveOpenJobSetsToLocalSettings();
if( aResaveProjectPreferences )
SaveOpenJobSetsToLocalSettings();
}
catch( ... )
{
@ -800,7 +802,7 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName )
m_leftWin->ReCreateTreePrj();
for( const wxString& jobset : Prj().GetLocalSettings().m_OpenJobSets )
OpenJobsFile( jobset );
OpenJobsFile( jobset, false, false );
// Rebuild the list of watched paths.
// however this is possible only when the main loop event handler is running,

View File

@ -142,7 +142,8 @@ public:
bool CloseProject( bool aSave );
void LoadProject( const wxFileName& aProjectFileName );
void OpenJobsFile( const wxFileName& aFileName, bool aCreate = false );
void OpenJobsFile( const wxFileName& aFileName, bool aCreate = false,
bool aResaveProjectPreferences = true );
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;