Fix search paths for default project template

This commit is contained in:
Jon Evans 2021-02-27 20:30:18 -05:00
parent cd7a2cd807
commit a70106a3bd
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include <wx/stdpaths.h>
#include <common.h>
#include <kiplatform/environment.h>
#include <search_stack.h>
#include <pgm_base.h>
#include <config.h> // to define DEFAULT_INSTALL_PATH
@ -70,7 +71,7 @@ void SystemDirsAppend( SEARCH_STACK* aSearchStack )
// According to wxWidgets documentation:
// Unix: ~/.appname
// Windows: C:\Documents and Settings\username\Application Data\appname
maybe.AddPaths( wxStandardPaths::Get().GetUserDataDir() );
maybe.AddPaths( KIPLATFORM::ENV::GetDocumentsPath() );
{
// Should be full path to this program executable.

View File

@ -37,6 +37,7 @@
#include <filehistory.h>
#include <hotkeys_basic.h>
#include <kiway.h>
#include <paths.h>
#include <settings/settings_manager.h>
#include <systemdirsappend.h>
#include <wildcards_and_files_ext.h>
@ -126,6 +127,8 @@ bool PGM_KICAD::OnPgmInit()
m_bm.m_search.AddPaths( fn.GetPath() );
}
m_bm.m_search.AddPaths( PATHS::GetUserTemplatesPath() );
// The KICAD6_TEMPLATE_DIR takes precedence over the search stack template path.
ENV_VAR_MAP_CITER it = GetLocalEnvVariables().find( "KICAD6_TEMPLATE_DIR" );