Don't auto-save local settings when migrating

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19540

(cherry picked from commit 7ce0f55305)
This commit is contained in:
Jon Evans
2025-01-08 08:43:28 -05:00
parent 4ed1954b4b
commit 77963d9ff8
4 changed files with 17 additions and 2 deletions
+5 -1
View File
@@ -42,7 +42,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
m_ZoneOpacity( 0.6 ),
m_ImageOpacity( 0.6 ),
m_SelectionFilter(),
m_project( aProject )
m_project( aProject ),
m_wasMigrated( false )
{
// Keep old files around
m_deleteLegacyAfterMigration = false;
@@ -275,6 +276,8 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
{
At( "board" ).erase( "visible_items" );
}
m_wasMigrated = true;
}
return true;
@@ -333,6 +336,7 @@ PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxStrin
}
At( "board" )["visible_items"] = visible;
m_wasMigrated = true;
}
return true;
+1
View File
@@ -94,6 +94,7 @@
#include <wx/socket.h>
#include <widgets/wx_aui_utils.h>
#include <drawing_sheet/ds_proxy_view_item.h>
#include <project/project_local_settings.h>
#define DIFF_SYMBOLS_DIALOG_NAME wxT( "DiffSymbolsDialog" )
+7
View File
@@ -71,6 +71,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
{
@@ -144,6 +149,8 @@ public:
private:
/// A link to the owning project
PROJECT* m_project;
bool m_wasMigrated;
};
#endif
+4 -1
View File
@@ -1168,7 +1168,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