7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 00:21:36 +00:00

design blocks: don't attempt to get file access times on dir

Causes errors on Windows
This commit is contained in:
Mike Williams 2024-09-10 15:00:09 -04:00
parent 895c977dd3
commit 5222b89ffd
2 changed files with 6 additions and 8 deletions

View File

@ -22,6 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <common.h>
#include <i18n_utility.h>
#include <wx/dir.h>
#include <wx/filename.h>
@ -136,12 +137,9 @@ const DESIGN_BLOCK_IO::IO_FILE_DESC DESIGN_BLOCK_IO::GetLibraryDesc() const
long long DESIGN_BLOCK_IO::GetLibraryTimestamp( const wxString& aLibraryPath ) const
{
wxFileName fn( aLibraryPath );
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
if( fn.IsFileReadable() && fn.GetModificationTime().IsValid() )
return fn.GetModificationTime().GetValue().GetValue();
else
return wxDateTime( 0.0 ).GetValue().GetValue();
return TimestampDir( aLibraryPath, fileSpec );
}

View File

@ -202,9 +202,9 @@ bool SCH_EDIT_FRAME::AddDesignBlockLibrary( const wxString& aFilename,
if( aFilename.IsEmpty() )
{
if( !LibraryFileBrowser( true, fn, FILEEXT::KiCadFootprintLibPathWildcard(),
FILEEXT::KiCadFootprintLibPathExtension, true, isGlobal,
PATHS::GetDefaultUserFootprintsPath() ) )
if( !LibraryFileBrowser( true, fn, FILEEXT::KiCadDesignBlockLibPathWildcard(),
FILEEXT::KiCadDesignBlockLibPathExtension, true, isGlobal,
PATHS::GetDefaultUserDesignBlocksPath() ) )
{
return false;
}