From 3a069620450360c3ee445bad363b3bb1dad536cd Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 6 Nov 2013 11:10:44 -0500 Subject: [PATCH] Set project footprint library table path environment variable before loading table. --- cvpcb/cfg.cpp | 2 +- pcbnew/pcbnew_config.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cvpcb/cfg.cpp b/cvpcb/cfg.cpp index bd043b986f..9bface0d68 100644 --- a/cvpcb/cfg.cpp +++ b/cvpcb/cfg.cpp @@ -101,11 +101,11 @@ void CVPCB_MAINFRAME::LoadProjectFile( const wxString& aFileName ) wxFileName projectFpLibTableFileName; projectFpLibTableFileName = FP_LIB_TABLE::GetProjectFileName( fn ); + FP_LIB_TABLE::SetProjectPathEnvVariable( projectFpLibTableFileName ); try { m_footprintLibTable->Load( projectFpLibTableFileName, m_globalFootprintTable ); - FP_LIB_TABLE::SetProjectPathEnvVariable( projectFpLibTableFileName ); } catch( IO_ERROR ioe ) { diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index a2f8d9d6b7..9b4cf28744 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -249,6 +249,8 @@ bool PCB_EDIT_FRAME::LoadProjectSettings( const wxString& aProjectFileName ) // Check if a project footprint table is defined and load it. If no project footprint // table is defined, then the global library table is the footprint library table. #if defined( USE_FP_LIB_TABLE ) + FP_LIB_TABLE::SetProjectPathEnvVariable( fn ); + delete m_footprintLibTable; wxFileName projectFpLibTableFileName; @@ -274,8 +276,6 @@ bool PCB_EDIT_FRAME::LoadProjectSettings( const wxString& aProjectFileName ) if( viewFrame ) viewFrame->SetFootprintLibTable( m_footprintLibTable ); - - FP_LIB_TABLE::SetProjectPathEnvVariable( fn ); #endif // Load the page layout decr file, from the filename stored in