This commit is contained in:
Jeff Young 2019-07-17 21:45:43 +01:00
parent d67c2d13c7
commit 3de00eef5f
4 changed files with 33 additions and 43 deletions

View File

@ -29,8 +29,6 @@
#include <kiway_express.h>
#include <macros.h>
#include <eda_dde.h>
#include <sch_draw_panel.h>
#include <tool/tool_manager.h>
#include <sch_edit_frame.h>
#include <general.h>
#include <eeschema_id.h>
@ -316,7 +314,7 @@ void SCH_EDIT_FRAME::SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT
std::string packet = FormatProbeItem( aObjectToSync, aLibItem );
if( packet.size() )
if( !packet.empty() )
{
if( Kiface().IsSingle() )
SendCommand( MSG_TO_PCB, packet.c_str() );
@ -337,7 +335,7 @@ void SCH_EDIT_FRAME::SendCrossProbeNetName( const wxString& aNetName )
std::string packet = StrPrintf( "$NET: \"%s\"", TO_UTF8( aNetName ) );
if( packet.size() )
if( !packet.empty() )
{
if( Kiface().IsSingle() )
SendCommand( MSG_TO_PCB, packet.c_str() );

View File

@ -32,13 +32,10 @@
#include <grid_tricks.h>
#include <kicad_string.h>
#include <refdes_utils.h>
#include <build_version.h>
#include <general.h>
#include <sch_view.h>
#include <class_library.h>
#include <sch_edit_frame.h>
#include <sch_reference_list.h>
#include <tool/tool_manager.h>
#include <tools/sch_editor_control.h>
#include <kiface_i.h>
#include <eda_doc.h>
@ -331,13 +328,11 @@ public:
if( aCol == REFERENCE || aCol == QUANTITY_COLUMN )
return; // Can't modify references or quantity
wxString value = aValue;
DATA_MODEL_ROW& rowGroup = m_rows[ aRow ];
wxString fieldName = m_fieldNames[ aCol ];
for( const auto& ref : rowGroup.m_Refs )
m_dataStore[ ref.GetComp()->GetTimeStamp() ][ fieldName ] = value;
m_dataStore[ ref.GetComp()->GetTimeStamp() ][ fieldName ] = aValue;
m_edited = true;
}
@ -485,7 +480,7 @@ public:
}
if( !matchFound )
m_rows.push_back( DATA_MODEL_ROW( ref, GROUP_SINGLETON ) );
m_rows.emplace_back( DATA_MODEL_ROW( ref, GROUP_SINGLETON ) );
}
if ( GetView() )
@ -518,7 +513,7 @@ public:
}
if( !matchFound )
children.push_back( DATA_MODEL_ROW( ref, CHILD_ITEM ) );
children.emplace_back( DATA_MODEL_ROW( ref, CHILD_ITEM ) );
}
if( children.size() < 2 )
@ -843,9 +838,9 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::AddField( const wxString& aName,
m_config->Read( "SymbolFieldEditor/Show/" + aName, &defaultShow );
m_config->Read( "SymbolFieldEditor/GroupBy/" + aName, &defaultSortBy );
fieldsCtrlRow.push_back( wxVariant( aName ) );
fieldsCtrlRow.push_back( wxVariant( defaultShow ) );
fieldsCtrlRow.push_back( wxVariant( defaultSortBy ) );
fieldsCtrlRow.emplace_back( wxVariant( aName ) );
fieldsCtrlRow.emplace_back( wxVariant( defaultShow ) );
fieldsCtrlRow.emplace_back( wxVariant( defaultSortBy ) );
m_fieldsCtrl->AppendItem( fieldsCtrlRow );
}
@ -875,11 +870,11 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::LoadFieldNames()
AddField( _( "Footprint" ), true, true );
AddField( _( "Datasheet" ), true, false );
for( auto fieldName : userFieldNames )
for( const wxString& fieldName : userFieldNames )
AddField( fieldName, true, false );
// Add any templateFieldNames which aren't already present in the userFieldNames
for( auto templateFieldName : m_parent->GetTemplateFieldNames() )
for( const TEMPLATE_FIELDNAME& templateFieldName : m_parent->GetTemplateFieldNames() )
if( userFieldNames.count( templateFieldName.m_Name ) == 0 )
AddField( templateFieldName.m_Name, false, false );
}

View File

@ -65,10 +65,6 @@ public:
int UpdateFind( const TOOL_EVENT& aEvent );
int ToggleLockSelected( const TOOL_EVENT& aEvent );
int LockSelected( const TOOL_EVENT& aEvent );
int UnlockSelected( const TOOL_EVENT& aEvent );
///> Notifies pcbnew about the selected item.
int CrossProbeToPcb( const TOOL_EVENT& aEvent );

View File

@ -515,7 +515,8 @@ bool EDIT_TOOL::changeTrackWidthOnClick( const PCBNEW_SELECTION& selection )
if( auto via = dyn_cast<VIA*>( item ) )
{
int new_width, new_drill;
int new_width;
int new_drill;
if( via->GetViaType() == VIA_MICROVIA )
{
@ -881,7 +882,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
else
m_commit->Push( _( "Delete" ) );
if( !m_lockedSelected && lockedItems.size() > 0 )
if( !m_lockedSelected && !lockedItems.empty() )
{
///> Popup nag for deleting locked items
STATUS_TEXT_POPUP statusPopup( frame() );