Don't split legacy paths

The '.' is a valid character in the legacy preferences, not a separator.
Also adds fail-safe catch for JSON throws

Fixes https://gitlab.com/kicad/code/kicad/issues/10211
This commit is contained in:
Seth Hillbrand 2022-01-03 10:05:45 -08:00
parent dec310f7f8
commit a326d777f0
1 changed files with 18 additions and 2 deletions

View File

@ -534,7 +534,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
if( aCfg->Read( key, &value ) )
{
std::string key_utf( key.ToUTF8() );
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
try
{
js[key_utf] = value;
}
catch(...)
{
continue;
}
}
}
@ -547,7 +555,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
if( aCfg->Read( key, &value ) )
{
std::string key_utf( key.ToUTF8() );
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
try
{
js[key_utf] = value;
}
catch(...)
{
continue;
}
}
}