Prevent multiple reloads when saving
Avoid potential issues with Mac libedit crashes (hopefully) Fixes https://gitlab.com/kicad/code/kicad/-/issues/14865
This commit is contained in:
parent
42e02552ac
commit
2aab24ef29
|
@ -241,6 +241,18 @@ public:
|
||||||
*/
|
*/
|
||||||
void OnSymChangeDebounceTimer( wxTimerEvent& aEvent );
|
void OnSymChangeDebounceTimer( wxTimerEvent& aEvent );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the modification time of the symbol library table file.
|
||||||
|
*
|
||||||
|
* This is used to detect changes to the symbol library table file.
|
||||||
|
*
|
||||||
|
* @param aTime is the modification time of the symbol library table file.
|
||||||
|
*/
|
||||||
|
void SetSymModificationTime( const wxDateTime& aTime )
|
||||||
|
{
|
||||||
|
m_watcherLastModified = aTime;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handleActivateEvent( wxActivateEvent& aEvent ) override;
|
void handleActivateEvent( wxActivateEvent& aEvent ) override;
|
||||||
|
|
||||||
|
|
|
@ -1130,6 +1130,10 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
|
||||||
if( !aNewFile )
|
if( !aNewFile )
|
||||||
{
|
{
|
||||||
m_libMgr->ClearLibraryModified( aLibrary );
|
m_libMgr->ClearLibraryModified( aLibrary );
|
||||||
|
|
||||||
|
// Update the library modification time so that we don't reload based on the watcher
|
||||||
|
if( aLibrary == getTargetLib() )
|
||||||
|
SetSymModificationTime( fn.GetModificationTime() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue