mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 14:50:11 +00:00
Rename design block file extension constant
Also add design blocks to the project archiver include list.
This commit is contained in:
parent
fc07aa6fb0
commit
ebfbedf7a7
@ -152,8 +152,8 @@ long long DESIGN_BLOCK_IO::GetLibraryTimestamp( const wxString& aLibraryPath ) c
|
||||
{
|
||||
wxFileName blockDir( aLibraryPath, filename );
|
||||
|
||||
// Check if the directory ends with ".block", if so hash all the files in it
|
||||
if( blockDir.GetFullName().EndsWith( FILEEXT::KiCadDesignBlockPathExtension ) )
|
||||
// Check if the directory ends with ".kicad_block", if so hash all the files in it
|
||||
if( blockDir.GetFullName().EndsWith( FILEEXT::KiCadDesignBlockFileExtension ) )
|
||||
ts += TimestampDir( blockDir.GetFullPath(), wxT( "*" ) );
|
||||
|
||||
hasMoreFiles = libDir.GetNext( &filename );
|
||||
@ -260,14 +260,14 @@ void DESIGN_BLOCK_IO::DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
|
||||
const wxString& aLibraryPath, bool aBestEfforts,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
{
|
||||
// From the starting directory, look for all directories ending in the .block extension
|
||||
// From the starting directory, look for all directories ending in the .kicad_block extension
|
||||
wxDir dir( aLibraryPath );
|
||||
|
||||
if( !dir.IsOpened() )
|
||||
return;
|
||||
|
||||
wxString dirname;
|
||||
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockPathExtension );
|
||||
wxString fileSpec = wxT( "*." ) + wxString( FILEEXT::KiCadDesignBlockFileExtension );
|
||||
bool cont = dir.GetFirst( &dirname, fileSpec, wxDIR_DIRS );
|
||||
|
||||
while( cont )
|
||||
@ -283,7 +283,7 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
{
|
||||
wxString dbPath = aLibraryPath + wxFileName::GetPathSeparator() +
|
||||
aDesignBlockName + wxT( "." ) + FILEEXT::KiCadDesignBlockPathExtension + wxFileName::GetPathSeparator();
|
||||
aDesignBlockName + wxT( "." ) + FILEEXT::KiCadDesignBlockFileExtension + wxFileName::GetPathSeparator();
|
||||
wxString dbSchPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::KiCadSchematicFileExtension;
|
||||
wxString dbMetadataPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::JsonFileExtension;
|
||||
|
||||
@ -360,7 +360,7 @@ void DESIGN_BLOCK_IO::DesignBlockSave( const wxString& aLibra
|
||||
// Create the design block folder
|
||||
wxFileName dbFolder( aLibraryPath + wxFileName::GetPathSeparator()
|
||||
+ aDesignBlock->GetLibId().GetLibItemName() + wxT( "." )
|
||||
+ FILEEXT::KiCadDesignBlockPathExtension
|
||||
+ FILEEXT::KiCadDesignBlockFileExtension
|
||||
+ wxFileName::GetPathSeparator() );
|
||||
|
||||
if( !dbFolder.DirExists() )
|
||||
@ -427,7 +427,7 @@ void DESIGN_BLOCK_IO::DesignBlockDelete( const wxString& aLibPath, const wxStrin
|
||||
const std::map<std::string, UTF8>* aProperties )
|
||||
{
|
||||
wxFileName dbDir = wxFileName( aLibPath + wxFileName::GetPathSeparator() + aDesignBlockName
|
||||
+ wxT( "." ) + FILEEXT::KiCadDesignBlockPathExtension );
|
||||
+ wxT( "." ) + FILEEXT::KiCadDesignBlockFileExtension );
|
||||
|
||||
if( !dbDir.DirExists() )
|
||||
{
|
||||
|
@ -155,6 +155,7 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
|
||||
wxT( "*.kicad_dru" ),
|
||||
wxT( "*.kicad_wks" ),
|
||||
wxT( "*.kicad_jobset" ),
|
||||
wxT( "*.kicad_block" ),
|
||||
wxT( "*.wbk" ),
|
||||
wxT( "fp-lib-table" ),
|
||||
wxT( "sym-lib-table" )
|
||||
|
@ -187,8 +187,8 @@ const std::string FILEEXT::IpcD356FileExtension( "d356" );
|
||||
const std::string FILEEXT::Ipc2581FileExtension( "xml" );
|
||||
const std::string FILEEXT::WorkbookFileExtension( "wbk" );
|
||||
|
||||
const std::string FILEEXT::KiCadDesignBlockLibPathExtension( "blocks" ); // this is a directory
|
||||
const std::string FILEEXT::KiCadDesignBlockPathExtension( "block" ); // this is a directory
|
||||
const std::string FILEEXT::KiCadDesignBlockLibPathExtension( "kicad_blocks" ); // this is a directory
|
||||
const std::string FILEEXT::KiCadDesignBlockFileExtension( "kicad_block" ); // this is a directory
|
||||
|
||||
const std::string FILEEXT::PngFileExtension( "png" );
|
||||
const std::string FILEEXT::JpegFileExtension( "jpg" );
|
||||
@ -343,10 +343,10 @@ wxString FILEEXT::KiCadFootprintLibPathWildcard()
|
||||
}
|
||||
|
||||
|
||||
wxString FILEEXT::KiCadDesignBlockPathWildcard()
|
||||
wxString FILEEXT::KiCadDesignBlockFileWildcard()
|
||||
{
|
||||
return _( "KiCad design block path" )
|
||||
+ AddFileExtListToFilter( { KiCadDesignBlockPathExtension } );
|
||||
return _( "KiCad design block files" )
|
||||
+ AddFileExtListToFilter( { KiCadDesignBlockFileExtension } );
|
||||
}
|
||||
|
||||
|
||||
@ -555,4 +555,4 @@ wxString FILEEXT::HotkeyFileWildcard()
|
||||
wxString FILEEXT::JobsetFileWildcard()
|
||||
{
|
||||
return _( "KiCad jobset files" ) + AddFileExtListToFilter( { KiCadJobSetFileExtension } );
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ bool SCH_EDIT_FRAME::AddDesignBlockLibrary( const wxString& aFilename,
|
||||
|
||||
wxString type = DESIGN_BLOCK_IO_MGR::ShowType( lib_type );
|
||||
|
||||
// KiCad lib is our default guess. So it might not have the .blocks extension
|
||||
// KiCad lib is our default guess. So it might not have the .kicad_blocks extension
|
||||
// In this case, the extension is part of the library name
|
||||
if( lib_type == DESIGN_BLOCK_IO_MGR::KICAD_SEXP
|
||||
&& fn.GetExt() != FILEEXT::KiCadDesignBlockLibPathExtension )
|
||||
|
@ -177,7 +177,7 @@ public:
|
||||
static const std::string WorkbookFileExtension;
|
||||
|
||||
static const std::string KiCadDesignBlockLibPathExtension;
|
||||
static const std::string KiCadDesignBlockPathExtension;
|
||||
static const std::string KiCadDesignBlockFileExtension;
|
||||
|
||||
static const std::string PngFileExtension;
|
||||
static const std::string JpegFileExtension;
|
||||
@ -254,7 +254,7 @@ public:
|
||||
static wxString KiCadFootprintLibFileWildcard();
|
||||
static wxString KiCadFootprintLibPathWildcard();
|
||||
static wxString KiCadDesignBlockLibPathWildcard();
|
||||
static wxString KiCadDesignBlockPathWildcard();
|
||||
static wxString KiCadDesignBlockFileWildcard();
|
||||
static wxString TextFileWildcard();
|
||||
static wxString ModLegacyExportFileWildcard();
|
||||
static wxString ErcFileWildcard();
|
||||
|
Loading…
Reference in New Issue
Block a user