Update schema versions so we can patch bad data from earlier bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/12180
This commit is contained in:
parent
e015f5b086
commit
a3dc38cb32
|
@ -42,7 +42,7 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV
|
|||
m_appSettingsSchemaVersion( aSchemaVersion )
|
||||
{
|
||||
// Make Coverity happy:
|
||||
m_LibTree.column_width = 360;
|
||||
m_LibTree.column_width = 300;
|
||||
m_Graphics.canvas_type = EDA_DRAW_PANEL_GAL::GAL_FALLBACK;
|
||||
|
||||
// Build parameters list:
|
||||
|
@ -73,13 +73,7 @@ APP_SETTINGS_BASE::APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaV
|
|||
&m_ColorPicker.default_tab, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<int>( "lib_tree.column_width",
|
||||
&m_LibTree.column_width, 360 ) );
|
||||
|
||||
// Now that we allow hiding/showing of the tree control, it's never terribly useful to
|
||||
// decrease the width to nothing, and wxWidgets appears to have some bugs where it sets it
|
||||
// way too narrow.
|
||||
if( m_LibTree.column_width < 360 )
|
||||
m_LibTree.column_width = 360;
|
||||
&m_LibTree.column_width, 300 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "printing.background",
|
||||
&m_Printing.background, false ) );
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
using namespace T_BOMCFG_T; // for the BOM_CFG_PARSER parser and its keywords
|
||||
|
||||
///! Update the schema version whenever a migration is required
|
||||
const int eeschemaSchemaVersion = 1;
|
||||
const int eeschemaSchemaVersion = 2;
|
||||
|
||||
/// Default value for bom.plugins
|
||||
const nlohmann::json defaultBomPlugins =
|
||||
|
@ -446,6 +446,21 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
|||
// Version 0 to 1: BOM plugin settings moved from sexpr to JSON
|
||||
return migrateBomSettings();
|
||||
} );
|
||||
|
||||
|
||||
registerMigration( 1, 2,
|
||||
[&]() -> bool
|
||||
{
|
||||
// We used to have a bug on GTK which would set the lib tree column width way
|
||||
// too narrow.
|
||||
if( OPT<int> optval = Get<int>( "lib_tree.column_width" ) )
|
||||
{
|
||||
if( optval < 150 )
|
||||
Set( "lib_tree.column_width", 300 );
|
||||
}
|
||||
|
||||
return true;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
|
||||
///! Update the schema version whenever a migration is required
|
||||
const int pcbnewSchemaVersion = 2;
|
||||
const int pcbnewSchemaVersion = 3;
|
||||
|
||||
|
||||
PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
||||
|
@ -578,6 +578,20 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
|||
return true;
|
||||
} );
|
||||
|
||||
|
||||
registerMigration( 2, 3,
|
||||
[&]() -> bool
|
||||
{
|
||||
// We used to have a bug on GTK which would set the lib tree column width way
|
||||
// too narrow.
|
||||
if( OPT<int> optval = Get<int>( "lib_tree.column_width" ) )
|
||||
{
|
||||
if( optval < 150 )
|
||||
Set( "lib_tree.column_width", 300 );
|
||||
}
|
||||
|
||||
return true;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue