Fixup settings loading

Settings loading needs to account for potential chaining, so each
instance should be created before being Load()ed.  Additionally, add the
settings loading to QA
This commit is contained in:
Seth Hillbrand 2023-04-18 15:59:30 -07:00
parent 51b6ec0dce
commit 32d17547e5
6 changed files with 22 additions and 7 deletions

View File

@ -33,7 +33,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/common
${CMAKE_SOURCE_DIR}/common/dialogs
${CMAKE_SOURCE_DIR}/libs/sexpr/include
${CMAKE_SOURCE_DIR}/3d-viewer
${INC_AFTER}
./dialogs
./libview

View File

@ -335,11 +335,12 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// This is process-level-initialization, not project-level-initialization of the DSO.
// Do nothing in here pertinent to a project!
InitSettings( new EESCHEMA_SETTINGS );
aProgram->GetSettingsManager().RegisterSettings( KifaceSettings() );
aProgram->GetSettingsManager().RegisterSettings( KifaceSettings(), false );
// Register the symbol editor settings as well because they share a KiFACE and need to be
// loaded prior to use to avoid threading deadlocks
aProgram->GetSettingsManager().RegisterSettings( new SYMBOL_EDITOR_SETTINGS, false );
aProgram->GetSettingsManager().Load();
start_common( aCtlBits );

View File

@ -348,14 +348,15 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// This is process-level-initialization, not project-level-initialization of the DSO.
// Do nothing in here pertinent to a project!
InitSettings( new PCBNEW_SETTINGS );
aProgram->GetSettingsManager().RegisterSettings( KifaceSettings() );
aProgram->GetSettingsManager().RegisterSettings( KifaceSettings(), false );
// Register the footprint editor settings as well because they share a KiFACE and need to be
// loaded prior to use to avoid threading deadlocks
aProgram->GetSettingsManager().RegisterSettings( new FOOTPRINT_EDITOR_SETTINGS );
aProgram->GetSettingsManager().RegisterSettings( new CVPCB_SETTINGS );
aProgram->GetSettingsManager().RegisterSettings( new EDA_3D_VIEWER_SETTINGS );
aProgram->GetSettingsManager().RegisterSettings( new FOOTPRINT_EDITOR_SETTINGS, false );
aProgram->GetSettingsManager().RegisterSettings( new CVPCB_SETTINGS, false );
aProgram->GetSettingsManager().RegisterSettings( new EDA_3D_VIEWER_SETTINGS, false );
aProgram->GetSettingsManager().Load();
start_common( aCtlBits );
if( !loadGlobalLibTable() )

View File

@ -83,6 +83,9 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr<BOARD> b )
#ifdef USE_TOOL_MANAGER
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
mgr.RegisterSettings( new PCBNEW_SETTINGS, false );
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(),

View File

@ -30,6 +30,9 @@
#include <kiplatform/app.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <eeschema_settings.h>
#include <symbol_editor/symbol_editor_settings.h>
#include <wx/app.h>
#include <wx/init.h>
@ -60,7 +63,9 @@ bool init_unit_test()
wxSetAssertHandler( &wxAssertThrower );
Pgm().InitPgm( true, true, true );
Pgm().GetSettingsManager().RegisterSettings( new EESCHEMA_SETTINGS, false );
Pgm().GetSettingsManager().RegisterSettings( new SYMBOL_EDITOR_SETTINGS, false );
Pgm().GetSettingsManager().Load();
return ok;
}

View File

@ -30,6 +30,9 @@
#include <kiplatform/app.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <eeschema_settings.h>
#include <symbol_editor/symbol_editor_settings.h>
#include <wx/app.h>
#include <wx/init.h>
@ -60,6 +63,9 @@ bool init_unit_test()
wxSetAssertHandler( &wxAssertThrower );
Pgm().InitPgm( true, true, true );
Pgm().GetSettingsManager().RegisterSettings( new EESCHEMA_SETTINGS, false );
Pgm().GetSettingsManager().RegisterSettings( new SYMBOL_EDITOR_SETTINGS, false );
Pgm().GetSettingsManager().Load();
return ok;
}