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
This commit is contained in:
Seth Hillbrand 2021-02-25 14:35:06 -08:00
parent 0dca0e752b
commit 54539d2cd7
1 changed files with 2 additions and 2 deletions

View File

@ -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 );
}