From e52d93429bde71cfeac5bce630d5ea88721de07f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 17 Apr 2014 17:02:36 -0500 Subject: [PATCH] The kicad.exe project manager was not finding the kicad.pro file because it did not know where the template directory was. --- kicad/kicad.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 742121c781..f6799d015f 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -79,6 +79,27 @@ bool PGM_KICAD::OnPgmInit( wxApp* aWxApp ) if( !initPgm() ) return false; + // Add search paths to feed the PGM_KICAD::SysSearch() function, + // currenly limited in support to only look for project templates + { + SEARCH_STACK bases; + + SystemDirsAppend( &bases ); + + // DBG( bases.Show( (std::string(__func__) + " bases").c_str() );) + + for( unsigned i = 0; i < bases.GetCount(); ++i ) + { + wxFileName fn( bases[i], wxEmptyString ); + + // Add KiCad template file path to search path list. + fn.AppendDir( wxT( "template" ) ); + m_bm.m_search.AddPaths( fn.GetPath() ); + } + + //DBG( m_bm.m_search.Show( (std::string( __func__ ) + " SysSearch()").c_str() );) + } + // Read current setup and reopen last directory if no filename to open on // command line. if( App().argc == 1 )