mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 14:50:11 +00:00
Don't auto-save local settings when migrating
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19540
This commit is contained in:
parent
302ceeb14e
commit
7ce0f55305
common/project
eeschema
include/project
pcbnew
@ -45,7 +45,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
m_ShapeOpacity( 1.0 ),
|
||||
m_ImageOpacity( 0.6 ),
|
||||
m_PcbSelectionFilter(),
|
||||
m_project( aProject )
|
||||
m_project( aProject ),
|
||||
m_wasMigrated( false )
|
||||
{
|
||||
// Keep old files around
|
||||
m_deleteLegacyAfterMigration = false;
|
||||
@ -356,6 +357,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
{
|
||||
At( "board" ).erase( "visible_items" );
|
||||
}
|
||||
|
||||
m_wasMigrated = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -414,6 +417,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
}
|
||||
|
||||
At( "board" )["visible_items"] = visible;
|
||||
m_wasMigrated = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -432,6 +436,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
At( ptr ).push_back( LAYER_SHAPES - GAL_LAYER_ID_START );
|
||||
else
|
||||
At( "board" ).erase( "visible_items" );
|
||||
|
||||
m_wasMigrated = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -461,6 +467,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
|
||||
}
|
||||
|
||||
At( ptr ) = newLayers;
|
||||
m_wasMigrated = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -103,6 +103,7 @@
|
||||
#include <widgets/panel_sch_selection_filter.h>
|
||||
#include <widgets/wx_aui_utils.h>
|
||||
#include <drawing_sheet/ds_proxy_view_item.h>
|
||||
#include <project/project_local_settings.h>
|
||||
|
||||
#ifdef KICAD_IPC_API
|
||||
#include <api/api_plugin_manager.h>
|
||||
@ -1097,7 +1098,8 @@ void SCH_EDIT_FRAME::doCloseWindow()
|
||||
}
|
||||
|
||||
// Make sure local settings are persisted
|
||||
SaveProjectLocalSettings();
|
||||
if( !Prj().GetLocalSettings().WasMigrated() )
|
||||
SaveProjectLocalSettings();
|
||||
|
||||
// Shutdown all running tools
|
||||
if( m_toolManager )
|
||||
|
@ -72,6 +72,11 @@ public:
|
||||
|
||||
void ClearFileState();
|
||||
|
||||
/**
|
||||
* @return true if the local settings needed to be migrated, and shouldn't be auto-saved
|
||||
*/
|
||||
bool WasMigrated() const { return m_wasMigrated; }
|
||||
|
||||
protected:
|
||||
wxString getFileExt() const override
|
||||
{
|
||||
@ -152,6 +157,8 @@ public:
|
||||
private:
|
||||
/// A link to the owning project
|
||||
PROJECT* m_project;
|
||||
|
||||
bool m_wasMigrated;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1269,7 +1269,10 @@ void PCB_EDIT_FRAME::doCloseWindow()
|
||||
}
|
||||
|
||||
// Make sure local settings are persisted
|
||||
SaveProjectLocalSettings();
|
||||
if( !Prj().GetLocalSettings().WasMigrated() )
|
||||
SaveProjectLocalSettings();
|
||||
else
|
||||
wxLogTrace( traceAutoSave, wxT( "Skipping auto-save of migrated local settings" ) );
|
||||
|
||||
// Do not show the layer manager during closing to avoid flicker
|
||||
// on some platforms (Windows) that generate useless redraw of items in
|
||||
|
Loading…
Reference in New Issue
Block a user