diff --git a/common/settings/color_settings.cpp b/common/settings/color_settings.cpp index 62a152837a..e615b2517d 100644 --- a/common/settings/color_settings.cpp +++ b/common/settings/color_settings.cpp @@ -270,7 +270,7 @@ bool COLOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) return false; } - +#include bool COLOR_SETTINGS::migrateSchema0to1() { /** @@ -298,7 +298,7 @@ bool COLOR_SETTINGS::migrateSchema0to1() COLOR_SETTINGS* fpsettings = m_manager->AddNewColorSettings( filename ); // Start out with a clone - fpsettings->Set( "", At( "" ) ); + fpsettings->m_internals->CloneFrom( *m_internals ); // Footprint editor now just looks at the "board" namespace fpsettings->Set( "board", fpsettings->At( "fpedit" ) ); diff --git a/include/settings/json_settings_internals.h b/include/settings/json_settings_internals.h index 1d8ef6faef..ff1b55c3c7 100644 --- a/include/settings/json_settings_internals.h +++ b/include/settings/json_settings_internals.h @@ -62,6 +62,12 @@ public: { return nlohmann::json::operator[]( PointerFromString( aPath ) ); } + + void CloneFrom( const JSON_SETTINGS_INTERNALS& aOther ) + { + nlohmann::json::json_pointer root( "" ); + this->nlohmann::json::operator[]( root ) = aOther.nlohmann::json::operator[]( root ); + } }; #endif // KICAD_JSON_SETTINGS_INTERNALS_H