Skip project backup in standalone mode

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4867
This commit is contained in:
Jon Evans 2020-07-12 11:42:05 -04:00
parent 2ea42196ed
commit a2041073ee
2 changed files with 21 additions and 8 deletions

View File

@ -729,10 +729,13 @@ bool SCH_EDIT_FRAME::SaveProject()
Pgm().GetSettingsManager().SaveProject(); Pgm().GetSettingsManager().SaveProject();
WX_STRING_REPORTER backupReporter( &msg ); if( !Kiface().IsSingle() )
{
WX_STRING_REPORTER backupReporter( &msg );
if( !GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) ) if( !GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) )
SetStatusText( msg, 0 ); SetStatusText( msg, 0 );
}
UpdateTitle(); UpdateTitle();
@ -782,8 +785,11 @@ bool SCH_EDIT_FRAME::doAutoSave()
{ {
m_autoSaveState = false; m_autoSaveState = false;
if( GetSettingsManager()->GetCommonSettings()->m_Backup.backup_on_autosave ) if( !Kiface().IsSingle() &&
GetSettingsManager()->GetCommonSettings()->m_Backup.backup_on_autosave )
{
GetSettingsManager()->TriggerBackupIfNeeded( NULL_REPORTER::GetInstance() ); GetSettingsManager()->TriggerBackupIfNeeded( NULL_REPORTER::GetInstance() );
}
} }
return autoSaveOk; return autoSaveOk;

View File

@ -34,6 +34,7 @@
#include <pgm_base.h> #include <pgm_base.h>
#include <msgpanel.h> #include <msgpanel.h>
#include <fp_lib_table.h> #include <fp_lib_table.h>
#include <kiface_i.h>
#include <kiway.h> #include <kiway.h>
#include <kiway_player.h> #include <kiway_player.h>
#include <trace_helpers.h> #include <trace_helpers.h>
@ -783,10 +784,13 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
return false; return false;
} }
WX_STRING_REPORTER backupReporter( &upperTxt ); if( !Kiface().IsSingle() )
{
WX_STRING_REPORTER backupReporter( &upperTxt );
if( GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) ) if( GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) )
upperTxt.clear(); upperTxt.clear();
}
GetBoard()->SetFileName( pcbFileName.GetFullPath() ); GetBoard()->SetFileName( pcbFileName.GetFullPath() );
UpdateTitle(); UpdateTitle();
@ -904,8 +908,11 @@ bool PCB_EDIT_FRAME::doAutoSave()
UpdateTitle(); UpdateTitle();
m_autoSaveState = false; m_autoSaveState = false;
if( GetSettingsManager()->GetCommonSettings()->m_Backup.backup_on_autosave ) if( !Kiface().IsSingle() &&
GetSettingsManager()->GetCommonSettings()->m_Backup.backup_on_autosave )
{
GetSettingsManager()->TriggerBackupIfNeeded( NULL_REPORTER::GetInstance() ); GetSettingsManager()->TriggerBackupIfNeeded( NULL_REPORTER::GetInstance() );
}
return true; return true;
} }