filter useless autosave tests, and optimization of autosave test in Eechema
This commit is contained in:
parent
f9abb112af
commit
58c32367ee
|
@ -168,7 +168,7 @@ bool EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent )
|
|||
if( !wxFrame::ProcessEvent( aEvent ) )
|
||||
return false;
|
||||
|
||||
if( IsShown() && m_hasAutoSave &&
|
||||
if( IsShown() && m_hasAutoSave && IsActive() &&
|
||||
(m_autoSaveState != isAutoSaveRequired()) && (m_autoSaveInterval > 0) )
|
||||
{
|
||||
if( !m_autoSaveState )
|
||||
|
|
|
@ -502,18 +502,6 @@ bool SCH_SHEET_LIST::IsModified()
|
|||
}
|
||||
|
||||
|
||||
bool SCH_SHEET_LIST::IsAutoSaveRequired()
|
||||
{
|
||||
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||
{
|
||||
if( (*it).LastScreen() && (*it).LastScreen()->IsSave() )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_LIST::ClearModifyStatus()
|
||||
{
|
||||
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
|
@ -355,13 +355,6 @@ public:
|
|||
*/
|
||||
bool IsModified();
|
||||
|
||||
/**
|
||||
* Function IsAutoSaveRequired
|
||||
* checks the entire hierarchy for any modifications that require auto save.
|
||||
* @return True if the hierarchy is modified otherwise false.
|
||||
*/
|
||||
bool IsAutoSaveRequired();
|
||||
|
||||
void ClearModifyStatus();
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.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
|
||||
|
@ -1267,9 +1267,13 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
|
|||
|
||||
if( g_RootSheet != NULL )
|
||||
{
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||
SCH_SCREENS screenList;
|
||||
|
||||
return sheetList.IsAutoSaveRequired();
|
||||
for( SCH_SCREEN* screen = screenList.GetFirst(); screen; screen = screenList.GetNext() )
|
||||
{
|
||||
if( screen->IsSave() )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue