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
1760a28e
Commit
1760a28e
authored
Jul 28, 2013
by
Ben Harris
Committed by
Dick Hollenbeck
Jul 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix FP_CACHE::Load()
parent
17b1c04f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+20
-19
No files found.
pcbnew/kicad_plugin.cpp
View file @
1760a28e
...
@@ -120,9 +120,9 @@ class FP_CACHE
...
@@ -120,9 +120,9 @@ class FP_CACHE
public
:
public
:
FP_CACHE
(
PCB_IO
*
aOwner
,
const
wxString
&
aLibraryPath
);
FP_CACHE
(
PCB_IO
*
aOwner
,
const
wxString
&
aLibraryPath
);
wxString
GetPath
()
const
{
return
m_lib_path
.
GetPath
();
}
wxString
GetPath
()
const
{
return
m_lib_path
.
GetPath
();
}
wxDateTime
GetLastModificationTime
()
const
{
return
m_mod_time
;
}
wxDateTime
GetLastModificationTime
()
const
{
return
m_mod_time
;
}
bool
IsWritable
()
const
{
return
m_lib_path
.
IsOk
()
&&
m_lib_path
.
IsDirWritable
();
}
bool
IsWritable
()
const
{
return
m_lib_path
.
IsOk
()
&&
m_lib_path
.
IsDirWritable
();
}
MODULE_MAP
&
GetModules
()
{
return
m_modules
;
}
MODULE_MAP
&
GetModules
()
{
return
m_modules
;
}
// Most all functions in this class throw IO_ERROR exceptions. There are no
// Most all functions in this class throw IO_ERROR exceptions. There are no
...
@@ -181,8 +181,7 @@ void FP_CACHE::Save()
...
@@ -181,8 +181,7 @@ void FP_CACHE::Save()
// Allow file output stream to go out of scope to close the file stream before
// Allow file output stream to go out of scope to close the file stream before
// renaming the file.
// renaming the file.
{
{
wxLogTrace
(
traceFootprintLibrary
,
wxT
(
"Creating temporary library file %s"
),
// wxLogTrace( traceFootprintLibrary, wxT( "Creating temporary library file %s" ), GetChars( tempFileName ) );
GetChars
(
tempFileName
)
);
FILE_OUTPUTFORMATTER
formatter
(
tempFileName
);
FILE_OUTPUTFORMATTER
formatter
(
tempFileName
);
...
@@ -218,26 +217,28 @@ void FP_CACHE::Load()
...
@@ -218,26 +217,28 @@ void FP_CACHE::Load()
wxString
fpFileName
;
wxString
fpFileName
;
wxString
wildcard
=
wxT
(
"*."
)
+
KiCadFootprintFileExtension
;
wxString
wildcard
=
wxT
(
"*."
)
+
KiCadFootprintFileExtension
;
if
(
!
dir
.
GetFirst
(
&
fpFileName
,
wildcard
,
wxDIR_FILES
)
)
if
(
dir
.
GetFirst
(
&
fpFileName
,
wildcard
,
wxDIR_FILES
)
)
return
;
do
{
{
// reader now owns fp, will close on exception or return
do
FILE_LINE_READER
reader
(
fpFileName
);
{
// prepend the libpath into fullPath
wxFileName
fullPath
(
m_lib_path
.
GetPath
(),
fpFileName
);
FILE_LINE_READER
reader
(
fullPath
.
GetFullPath
()
);
m_owner
->
m_parser
->
SetLineReader
(
&
reader
);
m_owner
->
m_parser
->
SetLineReader
(
&
reader
);
std
::
string
name
=
TO_UTF8
(
fpFileName
);
std
::
string
name
=
TO_UTF8
(
fpFileName
);
m_modules
.
insert
(
name
,
new
FP_CACHE_ITEM
(
(
MODULE
*
)
m_owner
->
m_parser
->
Parse
(),
fpFileName
)
);
m_modules
.
insert
(
name
,
new
FP_CACHE_ITEM
(
(
MODULE
*
)
m_owner
->
m_parser
->
Parse
(),
fpFileName
)
);
}
while
(
dir
.
GetNext
(
&
fpFileName
)
);
}
while
(
dir
.
GetNext
(
&
fpFileName
)
);
// Remember the file modification time of library file when the
// Remember the file modification time of library file when the
// cache snapshot was made, so that in a networked environment we will
// cache snapshot was made, so that in a networked environment we will
// reload the cache as needed.
// reload the cache as needed.
m_mod_time
=
GetLibModificationTime
();
m_mod_time
=
GetLibModificationTime
();
}
}
}
...
...
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