From 265e2d61be64da93f8de0c59e09811a56c3926ae Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 16 Jun 2024 10:46:22 +0100 Subject: [PATCH] Clear timestamp when clearing cache. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17913 (cherry picked from commit 5a9b6810097204224de930be2880c5d18ddca6b1) --- include/footprint_info.h | 5 +---- pcbnew/footprint_info_impl.cpp | 7 +++++++ pcbnew/footprint_info_impl.h | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/footprint_info.h b/include/footprint_info.h index 93003b0c43..e4000efcb9 100644 --- a/include/footprint_info.h +++ b/include/footprint_info.h @@ -191,10 +191,7 @@ public: /** * @return Clears the footprint info cache */ - void Clear() - { - m_list.clear(); - } + virtual void Clear() = 0; /** * Get info for a footprint by id. diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index 8f7596a4e1..2d33a058f2 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -66,6 +66,13 @@ void FOOTPRINT_INFO_IMPL::load() } +void FOOTPRINT_LIST_IMPL::Clear() +{ + m_list.clear(); + m_list_timestamp = 0; +} + + bool FOOTPRINT_LIST_IMPL::CatchErrors( const std::function& aFunc ) { try diff --git a/pcbnew/footprint_info_impl.h b/pcbnew/footprint_info_impl.h index 5f5d7d6803..7dc4450840 100644 --- a/pcbnew/footprint_info_impl.h +++ b/pcbnew/footprint_info_impl.h @@ -93,6 +93,8 @@ public: bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = nullptr, PROGRESS_REPORTER* aProgressReporter = nullptr ) override; + void Clear() override; + protected: void loadLibs(); void loadFootprints();