Eeschema: fix overzealous save file update UI event handler.

Apparently wxFileName stats the file on Windows when using the == operator
which causes slow response when adding sheets in designs saved on remote
shares.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5596
This commit is contained in:
Wayne Stambaugh 2020-12-13 08:42:28 -05:00
parent 276cb7590d
commit b532c4a2b8
3 changed files with 23 additions and 2 deletions

View File

@ -813,9 +813,9 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent ) void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
{ {
SCH_SHEET_LIST sheetList( g_RootSheet ); SCH_SCREENS screenList( g_RootSheet );
aEvent.Enable( sheetList.IsModified() ); aEvent.Enable( screenList.IsModified() );
} }

View File

@ -1668,3 +1668,17 @@ void SCH_SCREENS::BuildClientSheetPathList()
} }
} }
} }
bool SCH_SCREENS::IsModified() const
{
for( const SCH_SCREEN* screen : m_screens )
{
if( screen->IsModify() )
return true;
}
return false;
}

View File

@ -652,6 +652,13 @@ public:
*/ */
bool CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const; bool CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const;
/**
* Check if this screen list has any modified screens.
*
* @return true if there are any modified screens in this list.
*/
bool IsModified() const;
private: private:
void addScreenToList( SCH_SCREEN* aScreen ); void addScreenToList( SCH_SCREEN* aScreen );
void buildScreenList( SCH_SHEET* aSheet); void buildScreenList( SCH_SHEET* aSheet);