From 7196e7bc984d668c1365075de851f281a420e57d Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 15 Nov 2013 08:11:46 -0600 Subject: [PATCH] Show KIPRJMOD in DIALOG_FP_LIB_TABLE even if it has not been referenced by a URI. --- common/fp_lib_table.cpp | 11 ++++------- include/fp_lib_table.h | 7 ++++++- pcbnew/dialogs/dialog_fp_lib_table.cpp | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 8385662c3d..d3ee4ca41a 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -49,9 +49,6 @@ using namespace FP_LIB_TABLE_T; */ static const wxString traceFpLibTable( wxT( "KicadFpLibTable" ) ); -/// The evinronment variable name for the current project path. This is used interanally -/// at run time and is not exposed outside of the current process. -static wxString projectPathEnvVariableName( wxT( "KIPRJMOD" ) ); /// The footprint library table name used when no project file is passed to Pcbnew or CvPcb. /// This is used temporarily to store the project specific library table until the project @@ -726,14 +723,14 @@ void FP_LIB_TABLE::SetProjectPathEnvVariable( const wxFileName& aPath ) path = aPath.GetPath(); wxLogTrace( traceFpLibTable, wxT( "Setting env %s to <%s>." ), - GetChars( projectPathEnvVariableName ), GetChars( path ) ); - wxSetEnv( projectPathEnvVariableName, path ); + GetChars( ProjectPathEnvVariableName() ), GetChars( path ) ); + wxSetEnv( ProjectPathEnvVariableName(), path ); } -const wxString& FP_LIB_TABLE::GetProjectPathEnvVariableName() const +const wxString FP_LIB_TABLE::ProjectPathEnvVariableName() { - return projectPathEnvVariableName; + return wxT( "KIPRJMOD" ); } diff --git a/include/fp_lib_table.h b/include/fp_lib_table.h index 6820265483..6d77459806 100644 --- a/include/fp_lib_table.h +++ b/include/fp_lib_table.h @@ -567,7 +567,12 @@ public: static void SetProjectPathEnvVariable( const wxFileName& aPath ); - const wxString& GetProjectPathEnvVariableName() const; + /** + * Function ProjectPathEnvVarVariableName + * returns the name of the environment variable used to hold the directory of + * the current project on program startup. + */ + static const wxString ProjectPathEnvVariableName(); static wxString GetProjectFileName( const wxFileName& aPath ); diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index c9b1ac48cb..49a39de6c0 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -692,6 +692,11 @@ private: } } + // Make sure this special environment variable shows up even if it was + // not used yet. It is automatically set by KiCad to the directory holding + // the current project. + unique.insert( FP_LIB_TABLE::ProjectPathEnvVariableName() ); + m_path_subs_grid->AppendRows( unique.size() ); row = 0;