Ensure we have a destination for config template

In the event that we do not have a project configuration file, the
default template will be used.  But it needs a destination filename for
copy_pro_file_template().

Fixes: lp:1745022
* https://bugs.launchpad.net/kicad/+bug/1745022
This commit is contained in:
Seth Hillbrand 2019-01-28 17:14:39 -08:00
parent cf6ba6ad94
commit b71c2e5edf
1 changed files with 5 additions and 0 deletions

View File

@ -294,6 +294,11 @@ wxConfigBase* PROJECT::configCreate( const SEARCH_STACK& aSList,
wxConfigBase* cfg = 0;
wxString cur_pro_fn = !aProjectFileName ? GetProjectFullName() : aProjectFileName;
// If we do not have a project name or specified name, choose an empty file to store the
// temporary configuration data in.
if( cur_pro_fn.IsEmpty() )
cur_pro_fn = wxFileName::CreateTempFileName( GetProjectPath() );
if( wxFileName( cur_pro_fn ).IsFileReadable() )
{
// Note: currently, aGroupName is not used.