From ed99251f0b2683b3496974c105f730ab5a757648 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 28 Mar 2018 17:18:03 -0400 Subject: [PATCH] Add explicit file:// URI scheme for html help files This fixes the help location on MacOS --- common/eda_doc.cpp | 3 ++- common/searchhelpfilefullpath.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/eda_doc.cpp b/common/eda_doc.cpp index 45d84f20cb..a233edc4c1 100644 --- a/common/eda_doc.cpp +++ b/common/eda_doc.cpp @@ -98,7 +98,8 @@ bool GetAssociatedDocument( wxWindow* aParent, wxT( "http:" ), wxT( "https:" ), wxT( "ftp:" ), - wxT( "www." ) + wxT( "www." ), + wxT( "file:" ) }; for( unsigned ii = 0; ii < DIM(url_header); ii++ ) diff --git a/common/searchhelpfilefullpath.cpp b/common/searchhelpfilefullpath.cpp index 3d16255053..89122ba959 100644 --- a/common/searchhelpfilefullpath.cpp +++ b/common/searchhelpfilefullpath.cpp @@ -162,7 +162,11 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".html" ), &altsubdirs ); if( !fn.IsEmpty() ) + { + // Prepend URI protocol since we will open in a browser + fn = wxT( "file://" ) + fn; break; + } fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".pdf" ), &altsubdirs ); @@ -172,7 +176,11 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".html" ), &subdirs ); if( !fn.IsEmpty() ) + { + // Prepend URI protocol since we will open in a browser + fn = wxT( "file://" ) + fn; break; + } fn = FindFileInSearchPaths( ss, aBaseName + wxT( ".pdf" ), &subdirs );