Pcbnew: fix bug in footprint library plugin cache reloading.

Check the footprint library path modification against the last load
time and reload the cache if the path modification time has changed
when a new file is added to the footprint library path.

Fixes lp:1727977

https://bugs.launchpad.net/kicad/+bug/1727977
This commit is contained in:
Wayne Stambaugh 2018-02-10 17:14:53 -05:00
parent 5ef0b6b67e
commit e832212d89
1 changed files with 10 additions and 0 deletions

View File

@ -372,6 +372,16 @@ bool FP_CACHE::IsModified( const wxString& aLibPath, const wxString& aFootprintN
if( !m_lib_path.DirExists() || !IsPath( aLibPath ) )
return true;
wxLogTrace( traceFootprintLibrary, wxT( "File '%s', m_mod_time %s-%s, file mod time: %s-%s." ),
GetChars( m_lib_path.GetPath() ),
GetChars( m_mod_time.FormatDate() ), GetChars( m_mod_time.FormatTime() ),
GetChars( m_lib_path.GetModificationTime().FormatDate() ),
GetChars( m_lib_path.GetModificationTime().FormatTime() ) );
// If a file is added to or remove from the library path, the cache needs reloaded.
if( m_mod_time != m_lib_path.GetModificationTime() )
return true;
// If no footprint was specified, check every file modification time against the time
// it was loaded.
if( aFootprintName.IsEmpty() )