Don't treat project Save As path as a path and file name.
The single string ctor of wxFileName treats the string as a path and file name. If there is a dot in the last path name, it assumes that the last path is actually a file name and extension. Fixes https://gitlab.com/kicad/code/kicad/-/issues/10116
This commit is contained in:
parent
3a8ffd40b8
commit
fcc497509a
|
@ -561,7 +561,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
|||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
wxFileName newProjectDir( dlg.GetPath() );
|
||||
wxFileName newProjectDir( dlg.GetPath(), wxEmptyString );
|
||||
|
||||
if( !newProjectDir.IsAbsolute() )
|
||||
newProjectDir.MakeAbsolute();
|
||||
|
@ -592,7 +592,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
const wxString& newProjectDirPath = newProjectDir.GetFullPath();
|
||||
const wxString& newProjectName = newProjectDir.GetName();
|
||||
const wxString& newProjectName = newProjectDir.GetDirs().Last();
|
||||
wxDir currentProjectDir( currentProjectDirPath );
|
||||
|
||||
SAVE_AS_TRAVERSER traverser( m_frame, currentProjectDirPath, currentProjectName,
|
||||
|
|
Loading…
Reference in New Issue