mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 21:43:43 +00:00
Remove a couple of fixed-version-number stragglers.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18809
This commit is contained in:
parent
3e2d9354db
commit
f40cb8dcb8
common
@ -33,6 +33,7 @@
|
||||
#include <lib_table_lexer.h>
|
||||
#include <macros.h>
|
||||
#include <string_utils.h>
|
||||
#include <build_version.h>
|
||||
|
||||
#define OPT_SEP '|' ///< options separator character
|
||||
|
||||
@ -486,9 +487,17 @@ bool LIB_TABLE::migrate()
|
||||
wxString uri = row.GetFullURI( true );
|
||||
|
||||
// If the uri still has a variable in it, that means that the user does not have
|
||||
// these vars defined. We update the old vars to the KICAD7 versions on load
|
||||
row_updated |= ( uri.Replace( wxS( "${KICAD5_" ), wxS( "${KICAD7_" ), false ) > 0 );
|
||||
row_updated |= ( uri.Replace( wxS( "${KICAD6_" ), wxS( "${KICAD7_" ), false ) > 0 );
|
||||
// these vars defined. We update the old vars to the current versions on load
|
||||
|
||||
static wxString fmtStr = wxS( "${KICAD%d_" );
|
||||
int version = 0;
|
||||
std::tie(version, std::ignore, std::ignore) = GetMajorMinorPatchTuple();
|
||||
|
||||
for( int ii = 5; ii < version - 1; ++ii )
|
||||
{
|
||||
row_updated |= ( uri.Replace( wxString::Format( fmtStr, ii ),
|
||||
wxString::Format( fmtStr, version ), false ) > 0 );
|
||||
}
|
||||
|
||||
if( row_updated )
|
||||
{
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <settings/json_settings_internals.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <env_vars.h>
|
||||
|
||||
|
||||
SETTINGS_MANAGER::SETTINGS_MANAGER( bool aHeadless ) :
|
||||
@ -344,7 +345,7 @@ void SETTINGS_MANAGER::loadAllColorSettings()
|
||||
|
||||
wxFileName third_party_path;
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
auto it = env.find( wxS( "KICAD7_3RD_PARTY" ) );
|
||||
auto it = env.find( ENV_VAR::GetVersionedEnvVarName( wxS( "3RD_PARTY" ) ) );
|
||||
|
||||
if( it != env.end() && !it->second.GetValue().IsEmpty() )
|
||||
third_party_path.SetPath( it->second.GetValue() );
|
||||
|
Loading…
Reference in New Issue
Block a user