Coverity fixes: lambda parameters by reference
For BUTTON_ROW_PANEL::BTN_DEF_LIST, the button definition does not need to be passed by value, by non-const reference avoids copies and this addresses the Coverity warnings: 184130, 184134, 184140, 184167. Also use a unique_ptr to clarify ownership sementics when handing widget over to WX.
This commit is contained in:
parent
4bf52b9266
commit
787e410a55
|
@ -105,7 +105,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||||
wxID_RESET,
|
wxID_RESET,
|
||||||
_( "Reset Hotkeys" ),
|
_( "Reset Hotkeys" ),
|
||||||
_( "Undo all changes made so far in this dialog" ),
|
_( "Undo all changes made so far in this dialog" ),
|
||||||
[this]( wxCommandEvent ){
|
[this]( wxCommandEvent& ){
|
||||||
m_hotkeyListCtrl->ResetAllHotkeys( false );
|
m_hotkeyListCtrl->ResetAllHotkeys( false );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -113,7 +113,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_( "Set to Defaults" ),
|
_( "Set to Defaults" ),
|
||||||
_( "Set all hotkeys to the built-in KiCad defaults" ),
|
_( "Set all hotkeys to the built-in KiCad defaults" ),
|
||||||
[this]( wxCommandEvent ){
|
[this]( wxCommandEvent& ){
|
||||||
m_hotkeyListCtrl->ResetAllHotkeys( true );
|
m_hotkeyListCtrl->ResetAllHotkeys( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_( "Import..." ),
|
_( "Import..." ),
|
||||||
_( "Import hotkey definitions from an external file, replacing the current values" ),
|
_( "Import hotkey definitions from an external file, replacing the current values" ),
|
||||||
[this]( wxCommandEvent ){
|
[this]( wxCommandEvent& ){
|
||||||
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
|
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -132,15 +132,15 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_( "Export..." ),
|
_( "Export..." ),
|
||||||
_( "Export these hotkey definitions to an external file" ),
|
_( "Export these hotkey definitions to an external file" ),
|
||||||
[this]( wxCommandEvent ){
|
[this]( wxCommandEvent& ){
|
||||||
m_frame->ExportHotkeyConfigToFile( m_hotkeys, m_nickname );
|
m_frame->ExportHotkeyConfigToFile( m_hotkeys, m_nickname );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
auto btnPanel = new BUTTON_ROW_PANEL( this, l_btn_defs, r_btn_defs );
|
auto btnPanel = std::make_unique<BUTTON_ROW_PANEL>( this, l_btn_defs, r_btn_defs );
|
||||||
|
|
||||||
aSizer->Add( btnPanel, 0, wxEXPAND | wxTOP, KIUI::GetStdMargin() );
|
aSizer->Add( btnPanel.release(), 0, wxEXPAND | wxTOP, KIUI::GetStdMargin() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue