mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 11:00:13 +00:00
JSON_SETTINGS: Provide explicit CloneFrom
This commit is contained in:
parent
515669284a
commit
3f55093bff
@ -270,7 +270,7 @@ bool COLOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#include <iostream>
|
||||
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" ) );
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user