Don't save file state for an empty file

This commit is contained in:
Jon Evans 2020-08-26 18:36:42 -04:00
parent f1b1e59cf0
commit 9ebdd4bd83
1 changed files with 8 additions and 5 deletions

View File

@ -641,16 +641,19 @@ void EDA_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
bool fileOpen = m_isClosing && m_isNonUserClose; bool fileOpen = m_isClosing && m_isNonUserClose;
wxFileName rfn( GetCurrentFileName() ); wxString currentlyOpenedFile = GetCurrentFileName();
if( !currentlyOpenedFile.IsEmpty() )
{
wxFileName rfn( currentlyOpenedFile );
rfn.MakeRelativeTo( Prj().GetProjectPath() ); rfn.MakeRelativeTo( Prj().GetProjectPath() );
Prj().GetLocalSettings().SaveFileState( rfn.GetFullPath(), &aCfg->m_Window, fileOpen ); Prj().GetLocalSettings().SaveFileState( rfn.GetFullPath(), &aCfg->m_Window, fileOpen );
}
// Save the recently used files list // Save the recently used files list
if( m_fileHistory ) if( m_fileHistory )
{ {
// Save the currently opened file in the file history // Save the currently opened file in the file history
wxString currentlyOpenedFile = GetCurrentFileName();
if( !currentlyOpenedFile.IsEmpty() ) if( !currentlyOpenedFile.IsEmpty() )
UpdateFileHistory( currentlyOpenedFile ); UpdateFileHistory( currentlyOpenedFile );