diff --git a/include/wxBasePcbFrame.h b/include/wxBasePcbFrame.h index 951c13a573..1545cfda06 100644 --- a/include/wxBasePcbFrame.h +++ b/include/wxBasePcbFrame.h @@ -695,7 +695,7 @@ public: bool SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ); ///> Key in KifaceSettings to store the canvas type. - static const wxString CANVAS_TYPE_KEY; + static const wxChar CANVAS_TYPE_KEY[]; DECLARE_EVENT_TABLE() }; diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 95c4fc86c4..6b70e6fc77 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -61,6 +61,8 @@ #include #include +const wxChar PCB_BASE_FRAME::CANVAS_TYPE_KEY[] = wxT( "canvas_type" ); + // Configuration entry names. static const wxChar UserGridSizeXEntry[] = wxT( "PcbUserGrid_X" ); static const wxChar UserGridSizeYEntry[] = wxT( "PcbUserGrid_Y" ); @@ -983,11 +985,11 @@ void PCB_BASE_FRAME::UseGalCanvas( bool aEnable ) EDA_DRAW_PANEL_GAL::GAL_TYPE PCB_BASE_FRAME::LoadCanvasTypeSetting() const { EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - wxConfigBase* cfg = Kiface().KifaceSettings(); if( cfg ) - cfg->Read( CANVAS_TYPE_KEY, (long*) &canvasType ); + canvasType = (EDA_DRAW_PANEL_GAL::GAL_TYPE) cfg->ReadLong( CANVAS_TYPE_KEY, + EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ); if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE || canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST ) @@ -1016,6 +1018,3 @@ bool PCB_BASE_FRAME::SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas return false; } - - -const wxString PCB_BASE_FRAME::CANVAS_TYPE_KEY = wxT( "canvas_type" ); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 903faed85f..ec593616ce 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -460,7 +460,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : GetGalCanvas()->SwitchBackend( canvasType ); UseGalCanvas( true ); } - }