Test the directory opened explicitly to silence assert
Fixes KICAD-6FY
This commit is contained in:
parent
c143be6279
commit
a85478df97
|
@ -85,7 +85,8 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( const wxString& aWindowTitle,
|
||||||
importProj.m_TargetProj.MakeAbsolute();
|
importProj.m_TargetProj.MakeAbsolute();
|
||||||
|
|
||||||
// Check if the project directory is empty
|
// Check if the project directory is empty
|
||||||
if( wxDir( targetDir ).HasFiles() )
|
wxDir targetDirTest( targetDir );
|
||||||
|
if( targetDirTest.IsOpened() && targetDirTest.HasFiles() )
|
||||||
{
|
{
|
||||||
msg = _( "The selected directory is not empty. We recommend you "
|
msg = _( "The selected directory is not empty. We recommend you "
|
||||||
"create projects in their own clean directory.\n\nDo you "
|
"create projects in their own clean directory.\n\nDo you "
|
||||||
|
@ -112,6 +113,8 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( const wxString& aWindowTitle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
targetDirTest.Close();
|
||||||
|
|
||||||
CreateNewProject( importProj.m_TargetProj.GetFullPath(), false /* Don't create stub files */ );
|
CreateNewProject( importProj.m_TargetProj.GetFullPath(), false /* Don't create stub files */ );
|
||||||
LoadProject( importProj.m_TargetProj );
|
LoadProject( importProj.m_TargetProj );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue