From fedc6519cd2190c9640c2e2225d9e80344441d4a Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 12 Aug 2020 00:25:58 +0100 Subject: [PATCH] Preserve the externally defined variables in the configure paths dialog Previously the variables that were defined externally weren't being readded to the variable map, so they would not appear in the dialog the next time. --- common/dialogs/dialog_configure_paths.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index 115ff7b1e6..2c83ede8b6 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -223,14 +223,17 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataFromWindow() for( int row = 0; row < m_EnvVars->GetNumberRows(); ++row ) { - wxString name = m_EnvVars->GetCellValue( row, TV_NAME_COL ); - wxString path = m_EnvVars->GetCellValue( row, TV_VALUE_COL ); - wxString external = m_EnvVars->GetCellValue( row, TV_FLAG_COL ); + wxString name = m_EnvVars->GetCellValue( row, TV_NAME_COL ); + wxString path = m_EnvVars->GetCellValue( row, TV_VALUE_COL ); + wxString external = m_EnvVars->GetCellValue( row, TV_FLAG_COL ); + ENV_VAR_ITEM var( path ); if( external.Length() ) - continue; - - if( name.IsEmpty() ) + { + // Don't check for consistency on external variables, just use them as-is + var.SetDefinedExternally( true ); + } + else if( name.IsEmpty() ) { m_errorGrid = m_EnvVars; m_errorRow = row; @@ -247,7 +250,7 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataFromWindow() return false; } - envVarMap[ name ] = ENV_VAR_ITEM( path ); + envVarMap[ name ] = var; } Pgm().SetLocalEnvVariables( envVarMap );