Prevent stripping preceived extensions from new proj
wxFilename automatically detects extensions based on the last "." in a full filename. We need to re-add the extension if it is removed. Fixes: lp:1816862 * https://bugs.launchpad.net/kicad/+bug/1816862
This commit is contained in:
parent
f002382b4a
commit
49d3440529
|
@ -229,6 +229,12 @@ void KICAD_MANAGER_FRAME::OnNewProject( wxCommandEvent& aEvent )
|
|||
return;
|
||||
|
||||
wxFileName pro( dlg.GetPath() );
|
||||
|
||||
// wxFileName automatically extracts an extension. But if it isn't
|
||||
// a .pro extension, we should keep it as part of the filename
|
||||
if( pro.GetExt().ToStdString() != ProjectFileExtension )
|
||||
pro.SetName( pro.GetName() + wxT( "." ) + pro.GetExt() );
|
||||
|
||||
pro.SetExt( ProjectFileExtension ); // enforce extension
|
||||
|
||||
if( !pro.IsAbsolute() )
|
||||
|
|
Loading…
Reference in New Issue