Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
88ce5920
Commit
88ce5920
authored
Feb 06, 2015
by
Adam Wolf
Committed by
Wayne Stambaugh
Feb 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix OSX help search paths.
parent
7dadeadb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
searchhelpfilefullpath.cpp
common/searchhelpfilefullpath.cpp
+27
-10
No files found.
common/searchhelpfilefullpath.cpp
View file @
88ce5920
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 2014 CERN
* Copyright (C) 2014
-2015
CERN
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2014
-2015
KiCad Developers, see CHANGELOG.TXT for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
* Function FindFileInSearchPaths
* Function FindFileInSearchPaths
* looks in "this" for \a aFilename, but first modifies every search
* looks in "this" for \a aFilename, but first modifies every search
* path by appending a list of path fragments from aSubdirs. That modification
* path by appending a list of path fragments from aSubdirs. That modification
* is not re
nt
ative.
* is not re
l
ative.
*/
*/
wxString
FindFileInSearchPaths
(
const
SEARCH_STACK
&
aStack
,
wxString
FindFileInSearchPaths
(
const
SEARCH_STACK
&
aStack
,
const
wxString
&
aFilename
,
const
wxArrayString
*
aSubdirs
)
const
wxString
&
aFilename
,
const
wxArrayString
*
aSubdirs
)
...
@@ -73,7 +73,12 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
...
@@ -73,7 +73,12 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
// If there's a KICAD environment variable set, use that guy's path also
// If there's a KICAD environment variable set, use that guy's path also
ss
.
AddPaths
(
Pgm
().
GetKicadEnvVariable
(),
0
);
ss
.
AddPaths
(
Pgm
().
GetKicadEnvVariable
(),
0
);
#if 1 // && defined(__linux__)
#if defined(__WXMAC__)
ss
.
AddPaths
(
GetOSXKicadMachineDataDir
()
);
ss
.
AddPaths
(
Pgm
().
GetExecutablePath
(),
0
);
#endif
#if ! defined(__WXMAC__) // && defined(__linux__)
// Based on kicad-doc.bzr/CMakeLists.txt, line 20, the help files are
// Based on kicad-doc.bzr/CMakeLists.txt, line 20, the help files are
// installed into "<CMAKE_INSTALL_PREFIX>/share/doc/kicad/help" for linux.
// installed into "<CMAKE_INSTALL_PREFIX>/share/doc/kicad/help" for linux.
// This is ${KICAD_HELP} var in that CMakeLists.txt file.
// This is ${KICAD_HELP} var in that CMakeLists.txt file.
...
@@ -84,7 +89,7 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
...
@@ -84,7 +89,7 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
subdirs
.
Add
(
wxT
(
"help"
)
);
subdirs
.
Add
(
wxT
(
"help"
)
);
#endif
#endif
#if
1
// && defined(__WINDOWS__)
#if
! defined(__WXMAC__)
// && defined(__WINDOWS__)
// Based on kicad-doc.bzr/CMakeLists.txt, line 35, the help files are
// Based on kicad-doc.bzr/CMakeLists.txt, line 35, the help files are
// installed into "<CMAKE_INSTALL_PREFIX>/doc/help" for Windows.
// installed into "<CMAKE_INSTALL_PREFIX>/doc/help" for Windows.
// This is ${KICAD_HELP} var in that CMakeLists.txt file.
// This is ${KICAD_HELP} var in that CMakeLists.txt file.
...
@@ -93,6 +98,18 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
...
@@ -93,6 +98,18 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
altsubdirs
.
Add
(
wxT
(
"help"
)
);
altsubdirs
.
Add
(
wxT
(
"help"
)
);
#endif
#endif
#if defined (__WXMAC__)
// OS X packages can have the help files in
// /Library/Application\ Support/kicad/help,
// and in Contents/SharedSupport/help inside the
// bundle.
// Below we account for an international subdirectory.
subdirs
.
Add
(
wxT
(
"help"
)
);
altsubdirs
.
Add
(
wxT
(
"Contents"
)
);
altsubdirs
.
Add
(
wxT
(
"SharedSupport"
)
);
altsubdirs
.
Add
(
wxT
(
"help"
)
);
#endif
/* Search for a help file.
/* Search for a help file.
* we *must* find a help file.
* we *must* find a help file.
* so help is searched in directories in this order:
* so help is searched in directories in this order:
...
@@ -110,7 +127,7 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
...
@@ -110,7 +127,7 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
locale_name_dirs
.
Add
(
i18n
->
GetCanonicalName
()
);
// canonical name like fr_FR
locale_name_dirs
.
Add
(
i18n
->
GetCanonicalName
()
);
// canonical name like fr_FR
// wxLocale::GetName() does not return always the short name
// wxLocale::GetName() does not return always the short name
locale_name_dirs
.
Add
(
i18n
->
GetName
().
BeforeLast
(
'_'
)
);
// short canonical name like fr
locale_name_dirs
.
Add
(
i18n
->
GetName
().
BeforeLast
(
'_'
)
);
// short canonical name like fr
locale_name_dirs
.
Add
(
wxT
(
"en"
)
);
// default (en)
locale_name_dirs
.
Add
(
wxT
(
"en"
)
);
// default (en)
#if defined(DEBUG) && 0
#if defined(DEBUG) && 0
ss
.
Show
(
__func__
);
ss
.
Show
(
__func__
);
...
@@ -127,22 +144,22 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
...
@@ -127,22 +144,22 @@ wxString SearchHelpFileFullPath( const SEARCH_STACK& aSStack, const wxString& aB
subdirs
.
Add
(
locale_name_dirs
[
ii
]
);
subdirs
.
Add
(
locale_name_dirs
[
ii
]
);
altsubdirs
.
Add
(
locale_name_dirs
[
ii
]
);
altsubdirs
.
Add
(
locale_name_dirs
[
ii
]
);
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".html"
),
&
altsubdirs
);
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".html"
),
&
altsubdirs
);
if
(
!
fn
.
IsEmpty
()
)
if
(
!
fn
.
IsEmpty
()
)
break
;
break
;
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".pdf"
),
&
altsubdirs
);
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".pdf"
),
&
altsubdirs
);
if
(
!
fn
.
IsEmpty
()
)
if
(
!
fn
.
IsEmpty
()
)
break
;
break
;
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".html"
),
&
subdirs
);
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".html"
),
&
subdirs
);
if
(
!
fn
.
IsEmpty
()
)
if
(
!
fn
.
IsEmpty
()
)
break
;
break
;
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".pdf"
),
&
subdirs
);
fn
=
FindFileInSearchPaths
(
ss
,
aBaseName
+
wxT
(
".pdf"
),
&
subdirs
);
if
(
!
fn
.
IsEmpty
()
)
if
(
!
fn
.
IsEmpty
()
)
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment