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
04174ecd
Commit
04174ecd
authored
Feb 09, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solved: path problems when Kicad is installed on a server (Windows or Samba server)
parent
46d816fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
11 deletions
+29
-11
edaappl.cpp
common/edaappl.cpp
+29
-11
No files found.
common/edaappl.cpp
View file @
04174ecd
...
@@ -442,10 +442,15 @@ bool WinEDA_App::SetBinDir()
...
@@ -442,10 +442,15 @@ bool WinEDA_App::SetBinDir()
m_BinDir
=
argv
[
0
];
m_BinDir
=
argv
[
0
];
#endif
/* __UNIX__ */
#endif
/* __UNIX__ */
m_BinDir
.
Replace
(
WIN_STRING_DIR_SEP
,
UNIX_STRING_DIR_SEP
);
while
(
m_BinDir
.
Last
()
!=
DIR_SEP
)
while
(
m_BinDir
.
Last
()
!=
'/'
)
m_BinDir
.
RemoveLast
();
m_BinDir
.
RemoveLast
();
/* Use unix notation for paths. I am not sure this is a good idea,
* but it simplify compatibility between Windows and Unices
* However it is a potential problem in path handling under Windows
*/
m_BinDir
.
Replace
(
WIN_STRING_DIR_SEP
,
UNIX_STRING_DIR_SEP
);
wxFileName
pfn
(
wxT
(
"/posix/path/specification"
),
wxT
(
"filename"
)
);
wxFileName
pfn
(
wxT
(
"/posix/path/specification"
),
wxT
(
"filename"
)
);
wxFileName
wfn
(
wxT
(
"
\\
windows
\\
path
\\
specification"
),
wxT
(
"filename"
)
);
wxFileName
wfn
(
wxT
(
"
\\
windows
\\
path
\\
specification"
),
wxT
(
"filename"
)
);
wxLogDebug
(
wxT
(
"Posix path: "
)
+
pfn
.
GetFullPath
()
);
wxLogDebug
(
wxT
(
"Posix path: "
)
+
pfn
.
GetFullPath
()
);
...
@@ -464,8 +469,18 @@ bool WinEDA_App::SetBinDir()
...
@@ -464,8 +469,18 @@ bool WinEDA_App::SetBinDir()
void
WinEDA_App
::
SetDefaultSearchPaths
(
void
)
void
WinEDA_App
::
SetDefaultSearchPaths
(
void
)
{
{
size_t
i
;
size_t
i
;
wxString
path
;
wxString
path
=
m_BinDir
;
wxFileName
fn
(
m_BinDir
,
wxEmptyString
);
#ifdef __WINDOWS__
/* m_BinDir path is in unix notation.
* But wxFileName expect (to work fine) native notation
* specifically when using a path including a server, like \\myserver\local_path .
*/
path
.
Replace
(
UNIX_STRING_DIR_SEP
,
WIN_STRING_DIR_SEP
);
#endif
wxFileName
fn
(
path
,
wxEmptyString
);
/* User environment variable path is the first search path. Chances are
/* User environment variable path is the first search path. Chances are
* if the user is savvy enough to set an environment variable they know
* if the user is savvy enough to set an environment variable they know
...
@@ -479,7 +494,9 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -479,7 +494,9 @@ void WinEDA_App::SetDefaultSearchPaths( void )
/* Standard application data path if it is different from the binary
/* Standard application data path if it is different from the binary
* path. */
* path. */
if
(
fn
.
GetPath
()
!=
GetTraits
()
->
GetStandardPaths
().
GetDataDir
()
)
if
(
fn
.
GetPath
()
!=
GetTraits
()
->
GetStandardPaths
().
GetDataDir
()
)
{
m_searchPaths
.
Add
(
GetTraits
()
->
GetStandardPaths
().
GetDataDir
()
);
m_searchPaths
.
Add
(
GetTraits
()
->
GetStandardPaths
().
GetDataDir
()
);
}
/* Up on level relative to binary path with "share" appended for Windows. */
/* Up on level relative to binary path with "share" appended for Windows. */
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
...
@@ -745,9 +762,9 @@ void WinEDA_App::SetLanguagePath( void )
...
@@ -745,9 +762,9 @@ void WinEDA_App::SetLanguagePath( void )
fn
.
GetPath
()
);
fn
.
GetPath
()
);
wxLocale
::
AddCatalogLookupPathPrefix
(
fn
.
GetPath
()
);
wxLocale
::
AddCatalogLookupPathPrefix
(
fn
.
GetPath
()
);
}
}
fn
.
RemoveLastDir
();
// Append path for unix standard install
// Append path for unix standard install
fn
.
RemoveLastDir
();
fn
.
AppendDir
(
wxT
(
"kicad"
)
);
fn
.
AppendDir
(
wxT
(
"kicad"
)
);
fn
.
AppendDir
(
wxT
(
"internat"
)
);
fn
.
AppendDir
(
wxT
(
"internat"
)
);
if
(
fn
.
DirExists
()
)
if
(
fn
.
DirExists
()
)
...
@@ -832,6 +849,7 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
...
@@ -832,6 +849,7 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
for
(
j
=
0
;
j
<
subdirs
->
GetCount
();
j
++
)
for
(
j
=
0
;
j
<
subdirs
->
GetCount
();
j
++
)
fn
.
AppendDir
(
subdirs
->
Item
(
j
)
);
fn
.
AppendDir
(
subdirs
->
Item
(
j
)
);
}
}
if
(
fn
.
DirExists
()
)
if
(
fn
.
DirExists
()
)
{
{
wxLogDebug
(
_T
(
"Adding <"
)
+
fn
.
GetPath
()
+
_T
(
"> to "
)
+
wxLogDebug
(
_T
(
"Adding <"
)
+
fn
.
GetPath
()
+
_T
(
"> to "
)
+
...
...
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