Handle files that are kept in prj footprint folder
The project footprint folder gets renamed to the new project name. We need to handle non-footprint files that may be stored there by updating this path manually when copying extra files. Fixes https://gitlab.com/kicad/code/kicad/issues/8503
This commit is contained in:
parent
ebcce9ae0a
commit
4bb4606811
|
@ -411,8 +411,12 @@ public:
|
|||
else
|
||||
{
|
||||
// Everything we don't recognize just gets a straight copy.
|
||||
wxString destPath = destFile.GetPath();
|
||||
wxString destPath = destFile.GetPathWithSep();
|
||||
wxString destName = destFile.GetName();
|
||||
wxUniChar pathSep = wxFileName::GetPathSeparator();
|
||||
|
||||
wxString srcProjectFootprintLib = pathSep + m_projectName + ".pretty" + pathSep;
|
||||
wxString newProjectFootprintLib = pathSep + m_newProjectName + ".pretty" + pathSep;
|
||||
|
||||
if( destPath.StartsWith( m_projectDirPath ) )
|
||||
{
|
||||
|
@ -423,6 +427,10 @@ public:
|
|||
if( destName == m_projectName )
|
||||
destFile.SetName( m_newProjectName );
|
||||
|
||||
destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
|
||||
destFile.SetPath( destPath );
|
||||
|
||||
|
||||
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), m_errors );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue