diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index d4868db5b3..87d1428c0e 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -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() )