Commit 1760a28e authored by Ben Harris's avatar Ben Harris Committed by Dick Hollenbeck

fix FP_CACHE::Load()

parent 17b1c04f
......@@ -181,8 +181,7 @@ void FP_CACHE::Save()
// Allow file output stream to go out of scope to close the file stream before
// renaming the file.
{
wxLogTrace( traceFootprintLibrary, wxT( "Creating temporary library file %s" ),
GetChars( tempFileName ) );
// wxLogTrace( traceFootprintLibrary, wxT( "Creating temporary library file %s" ), GetChars( tempFileName ) );
FILE_OUTPUTFORMATTER formatter( tempFileName );
......@@ -218,13 +217,14 @@ void FP_CACHE::Load()
wxString fpFileName;
wxString wildcard = wxT( "*." ) + KiCadFootprintFileExtension;
if( !dir.GetFirst( &fpFileName, wildcard, wxDIR_FILES ) )
return;
if( dir.GetFirst( &fpFileName, wildcard, wxDIR_FILES ) )
{
do
{
// reader now owns fp, will close on exception or return
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 );
......@@ -238,6 +238,7 @@ void FP_CACHE::Load()
// cache snapshot was made, so that in a networked environment we will
// reload the cache as needed.
m_mod_time = GetLibModificationTime();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment