Coding policy fixes.

Using "this->" violates coding policy section 2.7.
This commit is contained in:
Wayne Stambaugh 2021-02-09 11:35:43 -05:00
parent a49a6c2f52
commit 5ecef204cd
19 changed files with 147 additions and 53 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 jean-pierre.charras
* Copyright (C) 1992-2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -201,7 +201,7 @@ BM2CMP_FRAME::~BM2CMP_FRAME()
* This needed for OSX: avoids further OnDraw processing after this
* destructor and before the native window is destroyed
*/
this->Freeze( );
Freeze();
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2017-2020 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2017-2021 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -398,7 +398,7 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString&
// to have a unique look background color for HTML pages is set to the default as it is
// used for all the other widgets
wxString htmlColor = ( this->GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
wxString htmlColor = ( GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
wxString textColor = GetForegroundColour().GetAsString( wxC2S_HTML_SYNTAX );
wxString linkColor =
wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ).GetAsString( wxC2S_HTML_SYNTAX );
@ -419,7 +419,7 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString&
// HTML font set to font properties as they are used for widgets to have an unique look
// under different platforms with HTML
wxFont font = this->GetFont();
wxFont font = GetFont();
htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
htmlWindow->SetPage( htmlPage );

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -141,8 +141,8 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent,
gridSizer->Fit( scrollWin );
panelSizer->Add( scrollWin, 1, wxEXPAND | wxALL, 5 );
this->SetSizer( panelSizer );
this->Layout();
SetSizer( panelSizer );
Layout();
panelSizer->Fit( this );
}

View File

@ -2,8 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -715,7 +714,7 @@ void WS_DATA_ITEM_TEXT::SetConstrainedTextSize()
int linewidth = 0;
size_micron.x = KiROUND( m_ConstrainedTextSize.x * FSCALE );
size_micron.y = KiROUND( m_ConstrainedTextSize.y * FSCALE );
WS_DRAW_ITEM_TEXT dummy( WS_DRAW_ITEM_TEXT( this, 0, this->m_FullText, wxPoint( 0, 0 ),
WS_DRAW_ITEM_TEXT dummy( WS_DRAW_ITEM_TEXT( this, 0, m_FullText, wxPoint( 0, 0 ),
size_micron, linewidth, m_Italic, m_Bold ) );
dummy.SetMultilineAllowed( true );
dummy.SetHorizJustify( m_Hjustify ) ;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -424,11 +424,11 @@ OPT<nlohmann::json> JSON_SETTINGS::GetJson( const std::string& aPath ) const
{
nlohmann::json::json_pointer ptr = PointerFromString( aPath );
if( this->contains( ptr ) )
if( contains( ptr ) )
{
try
{
return OPT<nlohmann::json>{ this->at( ptr ) };
return OPT<nlohmann::json>{ at( ptr ) };
}
catch( ... )
{

View File

@ -135,12 +135,12 @@ struct TOOL_MANAGER::TOOL_STATE
bool operator==( const TOOL_MANAGER::TOOL_STATE& aRhs ) const
{
return aRhs.theTool == this->theTool;
return aRhs.theTool == theTool;
}
bool operator!=( const TOOL_MANAGER::TOOL_STATE& aRhs ) const
{
return aRhs.theTool != this->theTool;
return aRhs.theTool != theTool;
}
/**

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2020 Ian McInerney <ian.s.mcinerney at ieee dot org>
* Copyright (C) 2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -103,7 +103,7 @@ void BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
pEventHandler->CallAfter(
[=]()
{
wxCommandEvent evt( wxEVT_BUTTON, this->GetId() );
wxCommandEvent evt( wxEVT_BUTTON, GetId() );
evt.SetEventObject( this );
GetEventHandler()->ProcessEvent( evt );
} );

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2018 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -42,8 +42,8 @@ BUTTON_ROW_PANEL::BUTTON_ROW_PANEL( wxWindow* aWindow,
addButtons( false, aRightBtns );
this->SetSizer( m_sizer );
this->Layout();
SetSizer( m_sizer );
Layout();
}
@ -73,4 +73,4 @@ void BUTTON_ROW_PANEL::addButtons( bool aLeft, const BTN_DEF_LIST& aDefs )
btn->Bind( wxEVT_COMMAND_BUTTON_CLICKED, def.m_callback );
}
}
}

View File

@ -1,8 +1,9 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016 Anil8735(https://stackoverflow.com/users/3659387/anil8753) from https://stackoverflow.com/a/37274011
* Copyright (C) 2016 Anil8735(https://stackoverflow.com/users/3659387/anil8753)
* from https://stackoverflow.com/a/37274011
* Copyright (C) 2020-2021 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -142,7 +143,7 @@ void SPLIT_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent )
pEventHandler->CallAfter(
[=]()
{
wxCommandEvent evt( wxEVT_BUTTON, this->GetId() );
wxCommandEvent evt( wxEVT_BUTTON, GetId() );
evt.SetEventObject( this );
GetEventHandler()->ProcessEvent( evt );
} );
@ -255,4 +256,4 @@ bool SPLIT_BUTTON::Enable( bool aEnable )
Refresh();
return aEnable;
}
}

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -327,7 +327,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
[this]( wxCommandEvent& )
{
// saveAssociations must be run immediately
this->GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
} );
// Connect the handlers for the ok/cancel buttons
@ -335,7 +335,7 @@ void CVPCB_MAINFRAME::setupEventHandlers()
[this]( wxCommandEvent& )
{
// saveAssociations must be run immediately, before running Close( true )
this->GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
GetToolManager()->RunAction( CVPCB_ACTIONS::saveAssociations, true );
Close( true );
}, wxID_OK );
Bind( wxEVT_BUTTON,

View File

@ -2,25 +2,119 @@
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"45_degree_only": false,
"min_clearance": 0.508
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"version": 1
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"copper_edge_clearance": "error",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "error",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_over_copper": "error",
"silk_overlap": "error",
"skew_out_of_range": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zone_has_empty_net": "error",
"zones_intersect": "error"
},
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"max_error": 0.005,
"min_clearance": 0.0,
"min_copper_edge_clearance": 0.01,
"min_hole_clearance": 0.0,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_silk_clearance": 0.0,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.19999999999999998,
"min_via_annular_width": 0.049999999999999996,
"min_via_diameter": 0.39999999999999997,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0
"solder_mask_min_width": 0.0,
"solder_paste_clearance": 0.0,
"solder_paste_margin_ratio": 0.0
},
"track_widths": [],
"via_dimensions": []
"via_dimensions": [],
"zones_allow_external_fillets": false,
"zones_use_no_outline": true
},
"layer_presets": []
},

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 Alexander Shuklin <Jasuramme@gmail.com>
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -75,7 +75,7 @@ void DIALOG_UPDATE_FROM_PCB::updateData()
{
bool successfulRun = false;
m_messagePanel->Clear();
BACK_ANNOTATE backAnno( this->m_frame,
BACK_ANNOTATE backAnno( m_frame,
m_messagePanel->Reporter(),
m_cbRelinkFootprints->GetValue(),
m_cbUpdateFootprints->GetValue(),

View File

@ -148,7 +148,7 @@ HIERARCHY_NAVIG_DLG::~HIERARCHY_NAVIG_DLG()
Unbind( wxEVT_TREE_ITEM_ACTIVATED, &HIERARCHY_NAVIG_DLG::onSelectSheetPath, this );
Unbind( wxEVT_TREE_SEL_CHANGED, &HIERARCHY_NAVIG_DLG::onSelectSheetPath, this );
m_Tree->Disconnect( wxEVT_CHAR, wxKeyEventHandler( HIERARCHY_TREE::onChar ) );
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HIERARCHY_NAVIG_DLG::OnCloseNav ) );
Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HIERARCHY_NAVIG_DLG::OnCloseNav ) );
}

View File

@ -5,7 +5,7 @@
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
*
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -868,7 +868,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const
void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
{
// the board itself
aMap[ this->m_Uuid ] = this;
aMap[ m_Uuid ] = this;
for( TRACK* track : Tracks() )
aMap[ track->m_Uuid ] = track;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -510,7 +510,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
NETLIST netlist;
STRING_FORMATTER sf;
for( FOOTPRINT* footprint : this->GetBoard()->Footprints() )
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
{
if( footprint->GetAttributes() & FP_BOARD_ONLY )
continue; // Don't add board-only footprints to the netlist

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2011 Jean-Pierre Charras, <jp.charras@wanadoo.fr>
* Copyright (C) 2013-2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -258,7 +258,7 @@ bool FOOTPRINT_LIST_IMPL::joinWorkers()
threads.emplace_back( [this, &queue_parsed]() {
wxString nickname;
while( this->m_queue_out.pop( nickname ) && !m_cancelled )
while( m_queue_out.pop( nickname ) && !m_cancelled )
{
wxArrayString fpnames;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Joshua Redstone redstone at gmail.com
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -153,7 +153,7 @@ PCB_GROUP* PCB_GROUP::DeepClone() const
PCB_GROUP* PCB_GROUP::DeepDuplicate() const
{
PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( this->Duplicate() );
PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( Duplicate() );
newGroup->m_items.clear();
for( BOARD_ITEM* member : m_items )

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -36,7 +36,7 @@ PYTHON_ACTION_PLUGIN::PYTHON_ACTION_PLUGIN( PyObject* aAction )
{
PyLOCK lock;
this->m_PyAction = aAction;
m_PyAction = aAction;
Py_XINCREF( aAction );
}
@ -45,7 +45,7 @@ PYTHON_ACTION_PLUGIN::~PYTHON_ACTION_PLUGIN()
{
PyLOCK lock;
Py_XDECREF( this->m_PyAction );
Py_XDECREF( m_PyAction );
}
@ -55,7 +55,7 @@ PyObject* PYTHON_ACTION_PLUGIN::CallMethod( const char* aMethod, PyObject* aArgl
PyErr_Clear();
// pFunc is a new reference to the desired method
PyObject* pFunc = PyObject_GetAttrString( this->m_PyAction, aMethod );
PyObject* pFunc = PyObject_GetAttrString( m_PyAction, aMethod );
if( pFunc && PyCallable_Check( pFunc ) )
{

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 NBEE Embedded Systems SL, Miguel Angel Ajo <miguelangel@ajo.es>
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -37,7 +37,7 @@ PYTHON_FOOTPRINT_WIZARD::PYTHON_FOOTPRINT_WIZARD( PyObject* aWizard )
{
PyLOCK lock;
this->m_PyWizard = aWizard;
m_PyWizard = aWizard;
Py_XINCREF( aWizard );
}
@ -46,7 +46,7 @@ PYTHON_FOOTPRINT_WIZARD::~PYTHON_FOOTPRINT_WIZARD()
{
PyLOCK lock;
Py_XDECREF( this->m_PyWizard );
Py_XDECREF( m_PyWizard );
}
@ -56,7 +56,7 @@ PyObject* PYTHON_FOOTPRINT_WIZARD::CallMethod( const char* aMethod, PyObject* aA
PyErr_Clear();
// pFunc is a new reference to the desired method
PyObject* pFunc = PyObject_GetAttrString( this->m_PyWizard, aMethod );
PyObject* pFunc = PyObject_GetAttrString( m_PyWizard, aMethod );
if( pFunc && PyCallable_Check( pFunc ) )
{