Fix shadowed definition of EAGLE constant

This commit is contained in:
Ian McInerney 2022-09-24 00:08:32 +01:00
parent 31498673b7
commit 6310f84a57
3 changed files with 15 additions and 16 deletions

View File

@ -34,7 +34,7 @@ bool IsFileFromEDATool( const wxFileName& aFileName, const EDA_TOOLS aTool )
{ {
switch( aTool ) switch( aTool )
{ {
case EAGLE: case EDA_TOOLS::EAGLE:
if( textFile.GetLineCount() > 2 if( textFile.GetLineCount() > 2
&& textFile[1].StartsWith( wxT( "<!DOCTYPE eagle SYSTEM" ) ) && textFile[1].StartsWith( wxT( "<!DOCTYPE eagle SYSTEM" ) )
&& textFile[2].StartsWith( wxT( "<eagle version" ) ) ) && textFile[2].StartsWith( wxT( "<eagle version" ) ) )

View File

@ -37,7 +37,7 @@
/** /**
* Enumeration of tools * Enumeration of tools
*/ */
enum EDA_TOOLS enum class EDA_TOOLS
{ {
EAGLE EAGLE
}; };

View File

@ -359,7 +359,7 @@ int KICAD_MANAGER_CONTROL::ImportNonKicadProj( const TOOL_EVENT& aEvent )
{ {
// Check if droppedFile is an eagle file. // Check if droppedFile is an eagle file.
// If not, return and do not import files. // If not, return and do not import files.
if( !IsFileFromEDATool( droppedFileName, EAGLE ) ) if( !IsFileFromEDATool( droppedFileName, EDA_TOOLS::EAGLE ) )
return -1; return -1;
schFileExtension = EagleSchematicFileExtension; schFileExtension = EagleSchematicFileExtension;
@ -367,19 +367,18 @@ int KICAD_MANAGER_CONTROL::ImportNonKicadProj( const TOOL_EVENT& aEvent )
schFileType = SCH_IO_MGR::SCH_EAGLE; schFileType = SCH_IO_MGR::SCH_EAGLE;
pcbFileType = IO_MGR::EAGLE; pcbFileType = IO_MGR::EAGLE;
} }
// Cadstar project.
else if( droppedFileName.GetExt() == CadstarSchematicFileExtension
|| droppedFileName.GetExt() == CadstarPcbFileExtension )
{
schFileExtension = CadstarSchematicFileExtension;
pcbFileExtension = CadstarPcbFileExtension;
schFileType = SCH_IO_MGR::SCH_CADSTAR_ARCHIVE;
pcbFileType = IO_MGR::CADSTAR_PCB_ARCHIVE;
}
else else
{ {
// Cadstar project. return -1;
if( droppedFileName.GetExt() == CadstarSchematicFileExtension
|| droppedFileName.GetExt() == CadstarPcbFileExtension )
{
schFileExtension = CadstarSchematicFileExtension;
pcbFileExtension = CadstarPcbFileExtension;
schFileType = SCH_IO_MGR::SCH_CADSTAR_ARCHIVE;
pcbFileType = IO_MGR::CADSTAR_PCB_ARCHIVE;
}
else
return -1;
} }
IMPORT_PROJ_HELPER importProj( m_frame, droppedFileName.GetFullPath(), schFileExtension, IMPORT_PROJ_HELPER importProj( m_frame, droppedFileName.GetFullPath(), schFileExtension,