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
6ebc2a52
Commit
6ebc2a52
authored
Aug 18, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed problems in relative paths calculations for libs and docs files
parent
51efe030
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
30 deletions
+29
-30
edaappl.cpp
common/edaappl.cpp
+11
-16
dialog_edit_module_for_BoardEditor.cpp
pcbnew/dialog_edit_module_for_BoardEditor.cpp
+8
-6
dialog_edit_module_for_Modedit.cpp
pcbnew/dialog_edit_module_for_Modedit.cpp
+10
-8
No files found.
common/edaappl.cpp
View file @
6ebc2a52
...
...
@@ -1013,26 +1013,21 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath( const wxString& aF
*/
wxFileName
fn
=
aFullFilename
;
wxString
filename
=
aFullFilename
;
int
pathlen
=
-
1
;
// path len, used to find the better subpath within defualts paths
unsigned
pathlen
=
fn
.
GetPath
().
Len
();
/* path len, used to find the better (shortest) subpath
* within defaults paths */
if
(
m_libSearchPaths
.
Index
(
fn
.
GetPath
()
)
!=
wxNOT_FOUND
)
// Ok, trivial case
filename
=
fn
.
GetName
();
else
// not in the default, : see if this file is in a subpath:
for
(
unsigned
kk
=
0
;
kk
<
m_libSearchPaths
.
GetCount
();
kk
++
)
{
filename
=
fn
.
GetPathWithSep
()
+
fn
.
GetFullName
();
for
(
unsigned
kk
=
0
;
kk
<
m_libSearchPaths
.
GetCount
();
kk
++
)
fn
=
aFullFilename
;
// Search for the shortest subpath within m_libSearchPaths:
if
(
fn
.
MakeRelativeTo
(
m_libSearchPaths
[
kk
]
)
)
{
if
(
fn
.
MakeRelativeTo
(
m_libSearchPaths
[
kk
]
)
)
if
(
fn
.
GetPathWithSep
().
StartsWith
(
wxT
(
".."
)
)
)
// Path outside kicad libs paths
continue
;
if
(
pathlen
>
fn
.
GetPath
().
Len
()
)
// A better (shortest) subpath is found
{
if
(
fn
.
GetPathWithSep
().
StartsWith
(
wxT
(
".."
)
)
)
// Path outside kicad libs paths
continue
;
if
(
pathlen
<
0
// a first subpath is found
||
pathlen
>
(
int
)
fn
.
GetPath
().
Len
()
)
// or a better subpath if found
{
filename
=
fn
.
GetPathWithSep
()
+
fn
.
GetFullName
();
pathlen
=
fn
.
GetPath
().
Len
();
}
fn
=
aFullFilename
;
//Try to find a better subpath
filename
=
fn
.
GetPathWithSep
()
+
fn
.
GetFullName
();
pathlen
=
fn
.
GetPath
().
Len
();
}
}
}
...
...
pcbnew/dialog_edit_module_for_BoardEditor.cpp
View file @
6ebc2a52
...
...
@@ -183,11 +183,13 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
while
(
draw3D
)
{
S3D_MASTER
*
draw3DCopy
=
new
S3D_MASTER
(
NULL
);
draw3DCopy
->
Copy
(
draw3D
);
m_Shapes3D_list
.
push_back
(
draw3DCopy
);
m_3D_ShapeNameListBox
->
Append
(
draw3DCopy
->
m_Shape3DName
);
if
(
!
draw3D
->
m_Shape3DName
.
IsEmpty
()
)
{
S3D_MASTER
*
draw3DCopy
=
new
S3D_MASTER
(
NULL
);
draw3DCopy
->
Copy
(
draw3D
);
m_Shapes3D_list
.
push_back
(
draw3DCopy
);
m_3D_ShapeNameListBox
->
Append
(
draw3DCopy
->
m_Shape3DName
);
}
draw3D
=
(
S3D_MASTER
*
)
draw3D
->
Next
();
}
...
...
@@ -297,7 +299,7 @@ void DIALOG_MODULE_BOARD_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
TransfertDisplayTo3DValues
(
m_LastSelected3DShapeIndex
);
m_LastSelected3DShapeIndex
=
m_3D_ShapeNameListBox
->
GetSelection
();
if
(
m_LastSelected3DShapeIndex
<
0
)
// happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
if
(
m_LastSelected3DShapeIndex
<
0
)
// happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
return
;
if
(
m_LastSelected3DShapeIndex
>=
(
int
)
m_Shapes3D_list
.
size
()
)
...
...
pcbnew/dialog_edit_module_for_Modedit.cpp
View file @
6ebc2a52
...
...
@@ -46,9 +46,9 @@ DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR()
}
/***************************************/
/***************************************
*****************
/
void
DIALOG_MODULE_MODULE_EDITOR
::
InitModeditProperties
()
/***************************************/
/***************************************
*****************
/
{
SetFocus
();
...
...
@@ -59,11 +59,13 @@ void DIALOG_MODULE_MODULE_EDITOR::InitModeditProperties()
while
(
draw3D
)
{
S3D_MASTER
*
draw3DCopy
=
new
S3D_MASTER
(
NULL
);
draw3DCopy
->
Copy
(
draw3D
);
m_Shapes3D_list
.
push_back
(
draw3DCopy
);
m_3D_ShapeNameListBox
->
Append
(
draw3DCopy
->
m_Shape3DName
);
if
(
!
draw3D
->
m_Shape3DName
.
IsEmpty
()
)
{
S3D_MASTER
*
draw3DCopy
=
new
S3D_MASTER
(
NULL
);
draw3DCopy
->
Copy
(
draw3D
);
m_Shapes3D_list
.
push_back
(
draw3DCopy
);
m_3D_ShapeNameListBox
->
Append
(
draw3DCopy
->
m_Shape3DName
);
}
draw3D
=
(
S3D_MASTER
*
)
draw3D
->
Next
();
}
...
...
@@ -175,7 +177,7 @@ void DIALOG_MODULE_MODULE_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
TransfertDisplayTo3DValues
(
m_LastSelected3DShapeIndex
);
m_LastSelected3DShapeIndex
=
m_3D_ShapeNameListBox
->
GetSelection
();
if
(
m_LastSelected3DShapeIndex
<
0
)
// happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
if
(
m_LastSelected3DShapeIndex
<
0
)
// happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
return
;
if
(
m_LastSelected3DShapeIndex
>=
(
int
)
m_Shapes3D_list
.
size
()
)
...
...
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