From f69d499527137734d20f1c16ed4bdb8ac1cbb11d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 10 Feb 2018 15:04:54 +0000 Subject: [PATCH] Use async footprint loader for Place Footprint. Fixes: lp:1674053 * https://bugs.launchpad.net/kicad/+bug/1674053 --- pcbnew/load_select_footprint.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 0f6fd81de8..7a6c0aeaf4 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -58,6 +58,7 @@ using namespace std::placeholders; #include #include #include +#include static void DisplayCmpDoc( wxString& aName, void* aData ); @@ -198,6 +199,18 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary, return NULL; } + // While some of the search methods can load a libraray at a time (and stop when + // a match is found), the async loader gives much better feedback and loads the + // libraries in parallel. + // If the footprints are already in the cache, ReadFootprintFiles() will return + // immediately. + WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 2 ); + MList.ReadFootprintFiles( aTable, libName.length() ? &libName : nullptr, &progressReporter ); + progressReporter.Show( false ); + + if( MList.GetErrorCount() ) + MList.DisplayErrors( this ); + if( dlg.IsKeyword() ) // Selection by keywords { allowWildSeach = false;