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
36e55865
Commit
36e55865
authored
Oct 28, 2007
by
kintel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed path handling under Mac OS X
parent
1d40e5a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
26 deletions
+23
-26
edaappl.cpp
common/edaappl.cpp
+23
-14
gestfich.cpp
common/gestfich.cpp
+0
-12
No files found.
common/edaappl.cpp
View file @
36e55865
...
...
@@ -199,20 +199,29 @@ void WinEDA_App::InitOnLineHelp()
/*******************************/
bool
WinEDA_App
::
SetBinDir
()
/*******************************/
/*
* Analyse la ligne de commande pour retrouver le chemin de l'executable
* Sauve en WinEDA_App::m_BinDir le repertoire de l'executable
*/
// Find the path to the executable and store it in WinEDA_App::m_BinDir
{
/* Calcul du chemin ou se trouve l'executable */
#ifdef __UNIX__
/* Sous LINUX ptarg[0] ne donne pas le chemin complet de l'executable,
* il faut le retrouver par la commande "which <filename> si aucun
* chemin n'est donne */
#ifdef __APPLE__
// Derive path from location of the app bundle
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
();
if
(
mainBundle
==
NULL
)
return
false
;
CFURLRef
urlref
=
CFBundleCopyBundleURL
(
mainBundle
);
if
(
urlref
==
NULL
)
return
false
;
CFStringRef
str
=
CFURLCopyFileSystemPath
(
urlref
,
kCFURLPOSIXPathStyle
);
if
(
str
==
NULL
)
return
false
;
char
*
native_str
=
NULL
;
int
len
=
CFStringGetMaximumSizeForEncoding
(
CFStringGetLength
(
str
),
kCFStringEncodingUTF8
)
+
1
;
native_str
=
new
char
[
len
];
CFStringGetCString
(
str
,
native_str
,
len
,
kCFStringEncodingUTF8
);
m_BinDir
=
CONV_FROM_UTF8
(
native_str
);
delete
[]
native_str
;
#elif defined(__UNIX__)
// Under Linux, if argv[0] doesn't the complete path to the executable,
// it's necessary to obtain it using "which <filename>".
FILE
*
ftmp
;
#define TMP_FILE "/tmp/kicad.tmp"
...
...
@@ -223,7 +232,7 @@ bool WinEDA_App::SetBinDir()
FileName
[
0
]
=
0
;
str_arg0
=
argv
[
0
];
if
(
strchr
(
(
const
char
*
)
argv
[
0
],
'/'
)
==
NULL
)
/
* pas de chemin */
if
(
strchr
(
(
const
char
*
)
argv
[
0
],
'/'
)
==
NULL
)
/
/ no path
{
sprintf
(
FileName
,
"which %s > %s"
,
CONV_TO_UTF8
(
str_arg0
),
TMP_FILE
);
ii
=
system
(
FileName
);
...
...
common/gestfich.cpp
View file @
36e55865
...
...
@@ -464,19 +464,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para
wxString
FullFileName
;
#ifdef __WXMAC__
// Mac part
wxGetEnv
(
"HOME"
,
&
FullFileName
);
FullFileName
+=
wxString
(
"/bin/"
)
+
ExecFile
;
if
(
!
wxFileExists
(
FullFileName
)
)
{
FullFileName
=
FindKicadFile
(
ExecFile
);
}
#else
FullFileName
=
FindKicadFile
(
ExecFile
);
#endif
if
(
wxFileExists
(
FullFileName
)
)
{
...
...
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