Don't overwite env vars with settings.

Fixes: lp:1740022
* https://bugs.launchpad.net/kicad/+bug/1740022
This commit is contained in:
Jeff Young 2018-03-08 19:16:51 +00:00
parent 8a35e58987
commit 182b134872
1 changed files with 7 additions and 0 deletions

View File

@ -641,6 +641,10 @@ void PGM_BASE::loadCommonSettings()
for( unsigned i = 0; i < entries.GetCount(); i++ )
{
wxString val = m_common_settings->Read( entries[i], wxEmptyString );
if( m_local_env_vars[ entries[i] ].GetDefinedExternally() )
continue;
m_local_env_vars[ entries[i] ] = ENV_VAR_ITEM( val, wxGetEnv( entries[i], NULL ) );
}
@ -668,6 +672,9 @@ void PGM_BASE::SaveCommonSettings()
for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
{
if( it->second.GetDefinedExternally() )
continue;
wxLogTrace( traceEnvVars, wxT( "Saving environment variable config entry %s as %s" ),
GetChars( it->first ), GetChars( it->second.GetValue() ) );
m_common_settings->Write( it->first, it->second.GetValue() );