From 3b3de58e5e18c7cda608d2ef4215a080735b6f6c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 27 Apr 2024 13:29:44 +0100 Subject: [PATCH] Make sure color settings are saved when modified. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17864 --- 3d-viewer/3d_canvas/board_adapter.cpp | 2 ++ common/settings/color_settings.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index 112d9f6e45..bbe7212219 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -708,6 +708,8 @@ void BOARD_ADAPTER::SetLayerColors( const std::map& aColors ) for( const auto& [ layer, color ] : aColors ) settings->SetColor( layer, color ); + + Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" ); } diff --git a/common/settings/color_settings.cpp b/common/settings/color_settings.cpp index a2cc245527..bb37d1fb15 100644 --- a/common/settings/color_settings.cpp +++ b/common/settings/color_settings.cpp @@ -36,7 +36,7 @@ const wxString COLOR_SETTINGS::COLOR_BUILTIN_CLASSIC = "_builtin_classic"; COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) : - JSON_SETTINGS( std::move( aFilename ), SETTINGS_LOC::COLORS, colorsSchemaVersion ), + JSON_SETTINGS( aFilename, SETTINGS_LOC::COLORS, colorsSchemaVersion ), m_overrideSchItemColors( false ) { if( aAbsolutePath )