From 54539d2cd7622a270fc5962d2a97a018730de37d Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 25 Feb 2021 14:35:06 -0800 Subject: [PATCH] Calculate timestamp the same way both times Timestamps were checked using a different routine than they were generated with, leading to the cache always being out of date. This uses the same routine for both. While it iterates over the directory twice during the initial load, this will never be dominant Fixes https://gitlab.com/kicad/code/kicad/issues/7711 --- pcbnew/plugins/kicad/kicad_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 110835140a..c3fa91f0b7 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -264,8 +264,6 @@ void FP_CACHE::Load() footprint->SetFPID( LIB_ID( wxEmptyString, fpName ) ); m_footprints.insert( fpName, new FP_CACHE_ITEM( footprint, fn ) ); - - m_cache_timestamp += fn.GetTimestamp(); } catch( const IO_ERROR& ioe ) { @@ -276,6 +274,8 @@ void FP_CACHE::Load() } } while( dir.GetNext( &fullName ) ); + m_cache_timestamp = GetTimestamp( m_lib_raw_path ); + if( !cacheError.IsEmpty() ) THROW_IO_ERROR( cacheError ); }