mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 19:33:44 +00:00
Optimize library migration
We don't need to re-validate the cache before saving each footprint. This add a large time sink. Instead, we only validate to ensure it exists and then skip future validations while migrating Fixes https://gitlab.com/kicad/code/kicad/-/issues/18529
This commit is contained in:
parent
7214ef1f14
commit
3478492db3
pcbnew/pcb_io
@ -2876,7 +2876,7 @@ void PCB_IO_KICAD_SEXPR::FootprintSave( const wxString& aLibraryPath, const FOOT
|
||||
// called for saving into a library path.
|
||||
m_ctl = CTL_FOR_LIBRARY;
|
||||
|
||||
validateCache( aLibraryPath );
|
||||
validateCache( aLibraryPath, !aProperties || !aProperties->contains( "skip_cache_validation" ) );
|
||||
|
||||
if( !m_cache->IsWritable() )
|
||||
{
|
||||
|
@ -213,6 +213,7 @@ bool PCB_IO_MGR::ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, con
|
||||
{
|
||||
bool bestEfforts = false; // throw on first error
|
||||
oldFilePI->FootprintEnumerate( fpNames, aOldFilePath, bestEfforts, aOldFileProps );
|
||||
std::map<std::string, UTF8> props { { "skip_cache_validation", "" } };
|
||||
|
||||
for ( const wxString& fpName : fpNames )
|
||||
{
|
||||
@ -221,7 +222,7 @@ bool PCB_IO_MGR::ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, con
|
||||
|
||||
try
|
||||
{
|
||||
kicadPI->FootprintSave( aNewFilePath, fp.get() );
|
||||
kicadPI->FootprintSave( aNewFilePath, fp.get(), &props );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user