Don't try to open files multiple times
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14703
(cherry picked from commit 09e8f72196
)
This commit is contained in:
parent
a42ef9de77
commit
6eb96851f9
|
@ -210,6 +210,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_files.clear();
|
||||||
|
|
||||||
for( const nlohmann::json& file : aVal )
|
for( const nlohmann::json& file : aVal )
|
||||||
{
|
{
|
||||||
PROJECT_FILE_STATE fileState;
|
PROJECT_FILE_STATE fileState;
|
||||||
|
|
|
@ -864,15 +864,19 @@ void KICAD_MANAGER_FRAME::OnIdle( wxIdleEvent& aEvent )
|
||||||
APP_PROGRESS_DIALOG progressReporter( _( "Restoring session" ), wxEmptyString,
|
APP_PROGRESS_DIALOG progressReporter( _( "Restoring session" ), wxEmptyString,
|
||||||
previousOpenCount, this );
|
previousOpenCount, this );
|
||||||
|
|
||||||
|
// We don't currently support opening more than one view per file
|
||||||
|
std::set<wxString> openedFiles;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for( const PROJECT_FILE_STATE& file : Prj().GetLocalSettings().m_files )
|
for( const PROJECT_FILE_STATE& file : Prj().GetLocalSettings().m_files )
|
||||||
{
|
{
|
||||||
if( file.open )
|
if( file.open && !openedFiles.count( file.fileName ) )
|
||||||
{
|
{
|
||||||
progressReporter.Update( i++,
|
progressReporter.Update( i++,
|
||||||
wxString::Format( _( "Restoring '%s'" ), file.fileName ) );
|
wxString::Format( _( "Restoring '%s'" ), file.fileName ) );
|
||||||
|
|
||||||
|
openedFiles.insert( file.fileName );
|
||||||
wxFileName fn( file.fileName );
|
wxFileName fn( file.fileName );
|
||||||
|
|
||||||
if( fn.GetExt() == LegacySchematicFileExtension
|
if( fn.GetExt() == LegacySchematicFileExtension
|
||||||
|
|
Loading…
Reference in New Issue