KiCad: don't rename page description file on new project from template.

Doing so will break the link in the schematic and/or board file so copy
page description file(s) verbatim to the new project folder.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6524
This commit is contained in:
Wayne Stambaugh 2021-05-05 07:38:35 -04:00
parent 5bc47a0c3b
commit b56ac54cb2
1 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Brian Sidebotham <brian.sidebotham@gmail.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -29,6 +29,8 @@
#include <wx/wfstream.h>
#include <wx/log.h>
#include <wildcards_and_files_ext.h>
#include "project_template.h"
@ -183,8 +185,10 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
// Do not rename project specific symbol libraries. This will break the symbol library
// table which will cause broken symbol library links in the schematic.
if( !( destination.GetExt() == "dcm"
|| ( destination.GetExt() == "lib" && !destination.GetName().EndsWith( "-cache" ) ) ) )
if( !( destination.GetExt() == PageLayoutDescrFileExtension )
&& !( destination.GetExt() == "dcm"
|| ( destination.GetExt() == "lib"
&& !destination.GetName().EndsWith( "-cache" ) ) ) )
currname.Replace( basename, aNewProjectPath.GetName() );
destination.SetName( currname );