From 1bcfd95675d67b2ce382c2fc403e9f44aae1d3fd Mon Sep 17 00:00:00 2001 From: Adam Wolf Date: Wed, 7 Jan 2015 13:11:30 -0500 Subject: [PATCH] Fix KiCad project file missing error meassage on first run and missing history file. --- kicad/kicad.cpp | 11 +++++++++-- kicad/prjconfig.cpp | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 76675381f1..b078fea36e 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -6,8 +6,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004-2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2004-2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2004-2015 KiCad Developers, see change_log.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 @@ -173,6 +173,13 @@ bool PGM_KICAD::OnPgmInit( wxApp* aWxApp ) prjloaded = true; // OnFileHistory() loads the project } } + else // there is no history + { + wxFileName namelessProject( wxGetCwd(), NAMELESS_PROJECT, + ProjectFileExtension ); + + frame->SetProjectFileName( namelessProject.GetFullPath() ); + } if( !prjloaded ) { diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index 922e6db008..b7a2aedfe5 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -6,8 +6,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2004-2012 Jean-Pierre Charras - * Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2004-2015 Jean-Pierre Charras + * Copyright (C) 2004-2015 KiCad Developers, see change_log.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 @@ -259,7 +259,7 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event ) wxString nameless_prj = NAMELESS_PROJECT wxT( ".pro" ); // Check if project file exists and if it is not noname.pro - if( !wxFileExists( prj_filename ) && !prj_filename.IsSameAs( nameless_prj ) ) + if( !wxFileExists( prj_filename ) && !wxFileName( prj_filename ).GetFullName().IsSameAs( nameless_prj ) ) { wxString msg = wxString::Format( _( "KiCad project file '%s' not found" ),