Erase library env vars if tables are not migrated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9660
This commit is contained in:
parent
7760d3275d
commit
f6263e0129
|
@ -527,6 +527,31 @@ bool SETTINGS_MANAGER::MigrateIfNeeded()
|
||||||
if( !traverser.GetErrors().empty() )
|
if( !traverser.GetErrors().empty() )
|
||||||
DisplayErrorMessage( nullptr, traverser.GetErrors() );
|
DisplayErrorMessage( nullptr, traverser.GetErrors() );
|
||||||
|
|
||||||
|
// Remove any library configuration if we didn't choose to import
|
||||||
|
if( !m_migrateLibraryTables )
|
||||||
|
{
|
||||||
|
COMMON_SETTINGS common;
|
||||||
|
wxString path = GetPathForSettingsFile( &common );
|
||||||
|
common.LoadFromFile( path );
|
||||||
|
|
||||||
|
const std::vector<wxString> libKeys = {
|
||||||
|
wxT( "KICAD6_SYMBOL_DIR" ),
|
||||||
|
wxT( "KICAD6_3DMODEL_DIR" ),
|
||||||
|
wxT( "KICAD6_FOOTPRINT_DIR" ),
|
||||||
|
|
||||||
|
// Deprecated keys
|
||||||
|
wxT( "KICAD_PTEMPLATES" ),
|
||||||
|
wxT( "KISYS3DMOD" ),
|
||||||
|
wxT( "KISYSMOD" ),
|
||||||
|
wxT( "KICAD_SYMBOL_DIR" ),
|
||||||
|
};
|
||||||
|
|
||||||
|
for( const wxString& key : libKeys )
|
||||||
|
common.m_Env.vars.erase( key );
|
||||||
|
|
||||||
|
common.SaveToFile( path );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue