diff --git a/3d-viewer/dialogs/appearance_controls_3D.cpp b/3d-viewer/dialogs/appearance_controls_3D.cpp index dbc280e63c..ae7b93c1dd 100644 --- a/3d-viewer/dialogs/appearance_controls_3D.cpp +++ b/3d-viewer/dialogs/appearance_controls_3D.cpp @@ -43,6 +43,7 @@ #include #include <../3d_rendering/opengl/render_3d_opengl.h> +#include /// Render Row abbreviation to reduce source width. #define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D @@ -872,7 +873,7 @@ void APPEARANCE_CONTROLS_3D::onLayerPresetChanged( wxCommandEvent& aEvent ) if( m_cbLayerPresets->FindString( name ) != wxNOT_FOUND ) m_cbLayerPresets->Delete( m_cbLayerPresets->FindString( name ) ); - alg::delete_if( cfg->m_LayerPresets, + std::erase_if( cfg->m_LayerPresets, [name]( const LAYER_PRESET_3D& preset ) { return preset.name == name; diff --git a/common/database/database_lib_settings.cpp b/common/database/database_lib_settings.cpp index d16ab3ca91..3e7c60285d 100644 --- a/common/database/database_lib_settings.cpp +++ b/common/database/database_lib_settings.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -91,7 +92,7 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) : // Sanitize library display names; currently only `/` is removed because we // use it as a separator and allow it in symbol names. - alg::delete_matching( table.name, '/' ); + std::erase( table.name, '/' ); if( entry.contains( "properties" ) && entry["properties"].is_object() ) { diff --git a/common/notifications_manager.cpp b/common/notifications_manager.cpp index d0bbeaa511..2931d22f74 100644 --- a/common/notifications_manager.cpp +++ b/common/notifications_manager.cpp @@ -38,6 +38,8 @@ #include #include #include + +#include #include #include @@ -377,7 +379,7 @@ void NOTIFICATIONS_MANAGER::onListWindowClosed( wxCloseEvent& aEvent ) { NOTIFICATIONS_LIST* evtWindow = dynamic_cast( aEvent.GetEventObject() ); - alg::delete_if( m_shownDialogs, [&]( NOTIFICATIONS_LIST* dialog ) + std::erase_if( m_shownDialogs, [&]( NOTIFICATIONS_LIST* dialog ) { return dialog == evtWindow; } ); @@ -426,7 +428,7 @@ void NOTIFICATIONS_MANAGER::RegisterStatusBar( KISTATUSBAR* aStatusBar ) void NOTIFICATIONS_MANAGER::UnregisterStatusBar( KISTATUSBAR* aStatusBar ) { - alg::delete_if( m_statusBars, [&]( KISTATUSBAR* statusBar ) + std::erase_if( m_statusBars, [&]( KISTATUSBAR* statusBar ) { return statusBar == aStatusBar; } ); diff --git a/common/project.cpp b/common/project.cpp index 244f96b67f..99436ed0b0 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -25,6 +25,7 @@ #include // required on Mac #include +#include #include #include #include @@ -249,10 +250,10 @@ void PROJECT::UnpinLibrary( const wxString& aLibrary, enum LIB_TYPE_T aLibType ) return; } - alg::delete_matching( *pinnedLibsFile, aLibrary ); + std::erase( *pinnedLibsFile, aLibrary ); Pgm().GetSettingsManager().SaveProject(); - alg::delete_matching( *pinnedLibsCfg, aLibrary ); + std::erase( *pinnedLibsCfg, aLibrary ); cfg->SaveToFile( Pgm().GetSettingsManager().GetPathForSettingsFile( cfg ) ); } diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index 173435ab9d..12b2207736 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -38,6 +38,8 @@ #include #include #include + +#include #include #include #include @@ -745,7 +747,7 @@ bool SETTINGS_MANAGER::GetPreviousVersionPaths( std::vector* aPaths ) } } - alg::delete_if( *aPaths, []( const wxString& aPath ) -> bool + std::erase_if( *aPaths, []( const wxString& aPath ) -> bool { wxFileName fulldir = wxFileName::DirName( aPath ); const wxArrayString& dirs = fulldir.GetDirs(); diff --git a/common/view/view.cpp b/common/view/view.cpp index 30d56e3415..430c498f52 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -369,7 +370,7 @@ void VIEW::Remove( VIEW_ITEM* aItem ) if( s_gcCounter > 4096 ) { // Perform defragmentation - alg::delete_if( *m_allItems, + std::erase_if( *m_allItems, []( VIEW_ITEM* it ) { return it == nullptr; diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index 12c212d685..ba8c9fc12e 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -69,7 +70,7 @@ void VIEW_GROUP::Add( VIEW_ITEM* aItem ) void VIEW_GROUP::Remove( VIEW_ITEM* aItem ) { - alg::delete_matching( m_groupItems, aItem ); + std::erase( m_groupItems, aItem ); } diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index c225f86636..8a2a4e9ee1 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -430,7 +431,7 @@ void LIB_TREE::updateRecentSearchMenu() if( !newEntry.IsEmpty() ) { if( alg::contains( recents, newEntry ) ) - alg::delete_matching( recents, newEntry ); + std::erase( recents, newEntry ); if( recents.size() >= RECENT_SEARCHES_MAX ) recents.pop_back(); diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index ee9c8417f1..b3295a11a3 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -959,7 +959,7 @@ std::set> CONNECTION_GRAPH::ExtractAffected } } - alg::delete_matching( m_items, aItem ); + std::erase( m_items, aItem ); }; for( SCH_ITEM* item : aItems ) @@ -987,7 +987,7 @@ std::set> CONNECTION_GRAPH::ExtractAffected removeSubgraphs( subgraphs ); for( const auto& [path, item] : retvals ) - alg::delete_matching( m_items, item ); + std::erase( m_items, item ); return retvals; } @@ -1006,7 +1006,7 @@ void CONNECTION_GRAPH::RemoveItem( SCH_ITEM* aItem ) subgraph = subgraph->m_absorbed_by; subgraph->RemoveItem( aItem ); - alg::delete_matching( m_items, aItem ); + std::erase( m_items, aItem ); m_item_to_subgraph_map.erase( it ); } @@ -1892,7 +1892,7 @@ void CONNECTION_GRAPH::processSubGraphs() wxS( "%ld (%s) is weakly driven and not unique. Changing to %s." ), subgraph->m_code, name, new_name ); - alg::delete_matching( *vec, subgraph ); + std::erase( *vec, subgraph ); m_net_name_to_subgraphs_map[new_name].emplace_back( subgraph ); @@ -2216,7 +2216,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a proc_sub_graph.Show(); // Absorbed subgraphs should no longer be considered - alg::delete_if( m_driver_subgraphs, [&]( const CONNECTION_SUBGRAPH* candidate ) -> bool + std::erase_if( m_driver_subgraphs, [&]( const CONNECTION_SUBGRAPH* candidate ) -> bool { return candidate->m_absorbed; } ); @@ -3083,7 +3083,7 @@ void CONNECTION_GRAPH::recacheSubgraphName( CONNECTION_SUBGRAPH* aSubgraph, if( it != m_net_name_to_subgraphs_map.end() ) { std::vector& vec = it->second; - alg::delete_matching( vec, aSubgraph ); + std::erase( vec, aSubgraph ); } wxLogTrace( ConnTrace, wxS( "recacheSubgraphName: %s => %s" ), aOldName, diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.cpp b/eeschema/netlist_exporters/netlist_exporter_spice.cpp index 7256c7ca04..4b21af1ab7 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_spice.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -709,7 +710,7 @@ SCH_SHEET_LIST NETLIST_EXPORTER_SPICE::BuildSheetList( unsigned aNetlistOptions else sheets = m_schematic->Hierarchy(); - alg::delete_if( sheets, + std::erase_if( sheets, [&]( const SCH_SHEET_PATH& sheet ) { return sheet.GetExcludedFromSim(); diff --git a/eeschema/picksymbol.cpp b/eeschema/picksymbol.cpp index a96d06b7a2..90a689fe0c 100644 --- a/eeschema/picksymbol.cpp +++ b/eeschema/picksymbol.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +82,7 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibrary( const SYMBOL_LIBRARY_FILTER if( sel.LibId.IsValid() ) { - alg::delete_if( aHistoryList, [&sel]( PICKED_SYMBOL const& i ) + std::erase_if( aHistoryList, [&sel]( PICKED_SYMBOL const& i ) { return i.LibId == sel.LibId; } ); diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 26f0aaa45a..85d9e0c67d 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -33,6 +33,7 @@ #include #include #include "scintilla_tricks.h" +#include class SCH_EDIT_FRAME; class SCH_TEXT; @@ -424,7 +425,7 @@ inline void SetFieldValue( std::vector& aFields, const wxString& aFie { if( aValue == "" ) { - alg::delete_if( aFields, [&]( const SCH_FIELD& field ) + std::erase_if( aFields, [&]( const SCH_FIELD& field ) { return field.GetName() == aFieldName; } ); diff --git a/eeschema/sch_io/ltspice/ltspice_schematic.cpp b/eeschema/sch_io/ltspice/ltspice_schematic.cpp index 967571eea4..e1111d13f3 100644 --- a/eeschema/sch_io/ltspice/ltspice_schematic.cpp +++ b/eeschema/sch_io/ltspice/ltspice_schematic.cpp @@ -34,6 +34,7 @@ #include #include #include +#include void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, @@ -81,7 +82,7 @@ void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, std::vector newSubSchematicElements = GetSchematicElements( buffer ); - alg::delete_if( newSubSchematicElements, + std::erase_if( newSubSchematicElements, [&mapOfAscFiles]( const LTSPICE_FILE& ii ) { return mapOfAscFiles[ii.ElementName].IsEmpty(); diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 4ca7ecbfe3..ca696b2d98 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -667,7 +668,7 @@ void SCH_LABEL_BASE::GetIntersheetRefs( const SCH_SHEET_PATH* aPath, if( !Schematic()->Settings().m_IntersheetRefsListOwnPage ) { int currentPage = Schematic()->CurrentSheet().GetVirtualPageNumber(); - alg::delete_matching( pageListCopy, currentPage ); + std::erase( pageListCopy, currentPage ); if( pageListCopy.empty() ) return; @@ -1983,7 +1984,7 @@ bool SCH_GLOBALLABEL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* tok if( !settings.m_IntersheetRefsListOwnPage ) { int currentPage = schematic->CurrentSheet().GetVirtualPageNumber(); - alg::delete_matching( pageListCopy, currentPage ); + std::erase( pageListCopy, currentPage ); } std::map sheetPages = schematic->GetVirtualPageToSheetPagesMap(); diff --git a/eeschema/sch_table.h b/eeschema/sch_table.h index e0f6d2e6b0..d854bca224 100644 --- a/eeschema/sch_table.h +++ b/eeschema/sch_table.h @@ -27,6 +27,7 @@ #include #include +#include class SCH_TABLE : public SCH_ITEM @@ -180,7 +181,7 @@ public: void DeleteMarkedCells() { - alg::delete_if( m_cells, + std::erase_if( m_cells, []( SCH_TABLECELL* cell ) { return ( cell->GetFlags() & STRUCT_DELETED ) > 0; diff --git a/eeschema/symbol_chooser_frame.cpp b/eeschema/symbol_chooser_frame.cpp index b298540f5d..fbb6c6d339 100644 --- a/eeschema/symbol_chooser_frame.cpp +++ b/eeschema/symbol_chooser_frame.cpp @@ -28,6 +28,7 @@ #include #include #include +#include static std::vector s_SymbolHistoryList; @@ -36,7 +37,7 @@ static unsigned s_SymbolHistoryMaxCount = 8; static void AddSymbolToHistory( const PICKED_SYMBOL& aSymbol ) { // Remove duplicates - alg::delete_if( s_SymbolHistoryList, + std::erase_if( s_SymbolHistoryList, [&]( const PICKED_SYMBOL& candidate ) -> bool { return candidate.LibId == aSymbol.LibId diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 5f1e2721a6..b065bb3c84 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -2799,7 +2800,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) // A SCH_GLOBALLABEL has a specific field for intersheet references that has // no meaning for other labels - alg::delete_if( new_label->GetFields(), + std::erase_if( new_label->GetFields(), [&]( SCH_FIELD& field ) { return field.GetId() == FIELD_T::INTERSHEET_REFS diff --git a/eeschema/widgets/panel_symbol_chooser.cpp b/eeschema/widgets/panel_symbol_chooser.cpp index a7ab82eb84..1bd662cd9b 100644 --- a/eeschema/widgets/panel_symbol_chooser.cpp +++ b/eeschema/widgets/panel_symbol_chooser.cpp @@ -38,6 +38,7 @@ #include #include // For SYMBOL_LIBRARY_FILTER #include +#include #include #include #include @@ -667,7 +668,7 @@ void PANEL_SYMBOL_CHOOSER::onFootprintSelected( wxCommandEvent& aEvent ) { m_fp_override = aEvent.GetString(); - alg::delete_if( m_field_edits, []( std::pair const& i ) + std::erase_if( m_field_edits, []( std::pair const& i ) { return i.first == FIELD_T::FOOTPRINT; } ); diff --git a/include/collector.h b/include/collector.h index 2df2527981..1471790502 100644 --- a/include/collector.h +++ b/include/collector.h @@ -27,6 +27,7 @@ #include #include +#include #include // SEARCH_RESULT @@ -119,7 +120,7 @@ public: */ void Remove( const EDA_ITEM* aItem ) { - alg::delete_if( m_list, [&aItem]( const EDA_ITEM* aCandidate ) + std::erase_if( m_list, [&aItem]( const EDA_ITEM* aCandidate ) { return aCandidate == aItem; } ); diff --git a/libs/core/include/core/kicad_algo.h b/libs/core/include/core/kicad_algo.h index 6cdcf63a83..73184646e8 100644 --- a/libs/core/include/core/kicad_algo.h +++ b/libs/core/include/core/kicad_algo.h @@ -154,28 +154,6 @@ bool within_wrapped_range( T __val, T __minval, T __maxval, T __wrap ) return __val >= __minval || __val <= __maxval; } -/** - * Covers for the horrifically named std::remove and std::remove_if (neither of which remove - * anything). - */ -/** - * @brief Deletes all values from \a __c which match \a __value. - */ -template -void delete_matching( _Container& __c, _Value __value ) -{ - __c.erase( std::remove( __c.begin(), __c.end(), __value ), __c.end() ); -} - -/** - * @brief Deletes all values from \a __c for which \a __f returns true. - */ -template -void delete_if( _Container& __c, _Function&& __f ) -{ - __c.erase( std::remove_if( __c.begin(), __c.end(), std::forward<_Function>( __f ) ), __c.end() ); -} - /** * @brief Deletes all duplicate values from \a __c. */ diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index da3457a96b..3e17d8b324 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -26,6 +26,7 @@ */ #include +#include #include @@ -1323,24 +1324,24 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aRemoveMode ) } case PCB_MARKER_T: - alg::delete_matching( m_markers, aBoardItem ); + std::erase( m_markers, aBoardItem ); break; case PCB_GROUP_T: - alg::delete_matching( m_groups, aBoardItem ); + std::erase( m_groups, aBoardItem ); break; case PCB_ZONE_T: - alg::delete_matching( m_zones, aBoardItem ); + std::erase( m_zones, aBoardItem ); break; case PCB_GENERATOR_T: - alg::delete_matching( m_generators, aBoardItem ); + std::erase( m_generators, aBoardItem ); break; case PCB_FOOTPRINT_T: { - alg::delete_matching( m_footprints, aBoardItem ); + std::erase( m_footprints, aBoardItem ); FOOTPRINT* footprint = static_cast( aBoardItem ); footprint->RunOnChildren( [&]( BOARD_ITEM* aChild ) @@ -1355,7 +1356,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aRemoveMode ) case PCB_TRACE_T: case PCB_ARC_T: case PCB_VIA_T: - alg::delete_matching( m_tracks, aBoardItem ); + std::erase( m_tracks, aBoardItem ); break; case PCB_DIM_ALIGNED_T: @@ -1371,7 +1372,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aRemoveMode ) case PCB_TABLE_T: case PCB_TARGET_T: { - alg::delete_matching( m_drawings, aBoardItem ); + std::erase( m_drawings, aBoardItem ); if( aBoardItem->Type() == PCB_TABLE_T ) { diff --git a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp index 1a66e75978..5f59fe1f39 100644 --- a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp +++ b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp @@ -223,13 +223,13 @@ FABMASTER::section_type FABMASTER::detectType( size_t aOffset ) /// We strip the underscores from all column names as some export variants use them and // some do not - alg::delete_if( row1, []( char c ){ return c == '_'; } ); - alg::delete_if( row2, []( char c ){ return c == '_'; } ); + std::erase_if( row1, []( char c ){ return c == '_'; } ); + std::erase_if( row2, []( char c ){ return c == '_'; } ); if( row.size() > 3 ) { row3 = row[3]; - alg::delete_if( row3, []( char c ){ return c == '_'; } ); + std::erase_if( row3, []( char c ){ return c == '_'; } ); } if( row1 == "REFDES" && row2 == "COMPCLASS" ) @@ -325,7 +325,7 @@ int FABMASTER::getColFromName( size_t aRow, const std::string& aStr ) { /// Some Fabmaster headers include the underscores while others do not /// so we strip them uniformly before comparing - alg::delete_if( header[i], []( const char c ) { return c == '_'; } ); + std::erase_if( header[i], []( const char c ) { return c == '_'; } ); if( header[i] == aStr ) return i; diff --git a/pcbnew/pcb_table.h b/pcbnew/pcb_table.h index 2b4dcb4a21..f13af424c3 100644 --- a/pcbnew/pcb_table.h +++ b/pcbnew/pcb_table.h @@ -28,6 +28,7 @@ #include #include #include +#include class PCB_TABLE : public BOARD_ITEM_CONTAINER @@ -179,7 +180,7 @@ public: void DeleteMarkedCells() { - alg::delete_if( m_cells, + std::erase_if( m_cells, []( PCB_TABLECELL* cell ) { return ( cell->GetFlags() & STRUCT_DELETED ) > 0; diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index c345c218fb..ab61442e47 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -24,6 +24,8 @@ #include #include +#include + #include #include "pns_diff_pair.h" @@ -395,7 +397,7 @@ bool DP_GATEWAYS::checkDiagonalAlignment( const VECTOR2I& a, const VECTOR2I& b ) void DP_GATEWAYS::FilterByOrientation( int aAngleMask, DIRECTION_45 aRefOrientation ) { - alg::delete_if( m_gateways, + std::erase_if( m_gateways, [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp ) { DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() ); diff --git a/pcbnew/router/pns_link_holder.h b/pcbnew/router/pns_link_holder.h index ba83d6803c..f26382a511 100644 --- a/pcbnew/router/pns_link_holder.h +++ b/pcbnew/router/pns_link_holder.h @@ -25,6 +25,7 @@ #define PCBNEW_ROUTER_PNS_LINK_HOLDER_H_ #include +#include #include "pns_item.h" #include "pns_linked_item.h" @@ -49,7 +50,7 @@ public: { wxCHECK_MSG( alg::contains( m_links, aLink ), /* void */, "Trying to unlink an item that is not linked" ); - alg::delete_matching( m_links, aLink ); + std::erase( m_links, aLink ); } ///< Return the list of links from the owning node that constitute this diff --git a/qa/data/config/9.99/kicad_common.json b/qa/data/config/9.99/kicad_common.json index c119c8be6c..5fa5996167 100644 --- a/qa/data/config/9.99/kicad_common.json +++ b/qa/data/config/9.99/kicad_common.json @@ -20,6 +20,9 @@ "limit_total_size": 104857600, "min_interval": 300 }, + "dialog": { + "controls": {} + }, "do_not_show_again": { "data_collection_prompt": false, "env_var_overwrite_warning": false, @@ -39,7 +42,9 @@ "useDefaultAuthor": true }, "graphics": { + "antialiasing_mode": 2, "cairo_antialiasing_mode": 0, + "canvas_type": 1, "opengl_antialiasing_mode": 1 }, "input": {