28 #include <wx/arrstr.h> 44 basePaths.Show( wxString( __func__ ) + wxT(
": basePaths" ) );
53 wxLocale* currentLocale =
Pgm().GetLocale();
54 wxArrayString localeNameDirs;
57 localeNameDirs.Add( currentLocale->GetCanonicalName() );
61 localeNameDirs.Add( currentLocale->GetName().BeforeLast(
'_' ) );
64 localeNameDirs.Add( wxT(
"en" ) );
66 for( wxString& locale : localeNameDirs )
70 for( wxString& base : basePaths )
72 wxFileName
path( base, wxEmptyString );
75 path.AppendDir( wxT(
"help" ) );
76 path.AppendDir( locale );
80 path.InsertDir(
path.GetDirCount() - 2, wxT(
"doc" ) );
84 path.InsertDir(
path.GetDirCount() - 2, wxT(
"kicad" ) );
89 docPaths.Show( wxString( __func__ ) + wxT(
": docPaths (" ) + locale + wxT(
")" ) );
93 wxLogTrace(
tracePathsAndFiles, wxT(
"Checking SEARCH_STACK for file %s.html" ), aBaseName );
94 helpFile = docPaths.FindValidPath( aBaseName + wxT(
".html" ) );
96 if( !helpFile.IsEmpty() )
99 helpFile = wxT(
"file://" ) + helpFile;
104 wxLogTrace(
tracePathsAndFiles, wxT(
"Checking SEARCH_STACK for file %s.pdf" ), aBaseName );
105 helpFile = docPaths.FindValidPath( aBaseName + wxT(
".pdf" ) );
107 if( !helpFile.IsEmpty() )
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
System directories search utilities.
Look for files in a number of paths.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
static wxString GetDocumentationPath()
Gets the documentation path, which is the base path for help files.
wxString SearchHelpFileFullPath(const wxString &aBaseName)
Return the help file's full path.
void SystemDirsAppend(SEARCH_STACK *aSearchStack)
Append system places to aSearchStack in a platform specific way and pertinent to KiCad programs.
wxLogTrace helper definitions.
void AddPaths(const wxString &aPaths, int aIndex=-1)
Insert or append path(s).