Cleanup some unused variables

* Make the app progress indicator only have the indeterminate state
  when the taskbar indicator is used (causes an uused variable warning
  on wx<3.1)
* Remove unused dry run variable in pcb_netlist.h
* Remove unused forceDropAnnotations from the paste special dialog
  since the dialog only controls keeping them.
This commit is contained in:
Ian McInerney 2020-08-24 01:51:23 +01:00
parent 750b186582
commit 2f7094b352
7 changed files with 17 additions and 26 deletions

View File

@ -28,11 +28,13 @@
APP_PROGRESS_DIALOG::APP_PROGRESS_DIALOG( const wxString& aTitle, const wxString& aMessage,
int aMaximum, wxWindow* aParent,
bool aIndeterminateTaskBarStatus, int aStyle )
: wxProgressDialog( aTitle, aMessage, aMaximum, aParent, aStyle ),
: wxProgressDialog( aTitle, aMessage, aMaximum, aParent, aStyle )
#if wxCHECK_VERSION( 3, 1, 0 )
,
m_appProgressIndicator( aParent, aMaximum ),
#endif
m_indeterminateTaskBarStatus( aIndeterminateTaskBarStatus )
#endif
{
#if wxCHECK_VERSION( 3, 1, 0 )
if( m_indeterminateTaskBarStatus )

View File

@ -27,10 +27,9 @@
static bool g_keepAnnotations = true;
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* parent, bool* aKeep, bool* aDrop ) :
DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* parent, bool* aKeep ) :
DIALOG_PASTE_SPECIAL_BASE( parent ),
m_keep( aKeep ),
m_drop( aDrop )
m_keep( aKeep )
{
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();

View File

@ -36,14 +36,13 @@ class DIALOG_PASTE_SPECIAL : public DIALOG_PASTE_SPECIAL_BASE
{
public:
DIALOG_PASTE_SPECIAL( wxWindow* parent, bool* aKeepAnnotations, bool* aDropAnnotations );
DIALOG_PASTE_SPECIAL( wxWindow* parent, bool* aKeepAnnotations );
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
private:
bool* m_keep;
bool* m_drop;
};
#endif // DIALOG_PASTE_SPECIAL_H

View File

@ -192,9 +192,9 @@ void ERC_TESTER::TestTextVars( KIGFX::WS_PROXY_VIEW_ITEM* aWorksheet )
}
else if( item->Type() == SCH_SHEET_T )
{
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
SCH_SHEET* subSheet = static_cast<SCH_SHEET*>( item );
for( SCH_FIELD& field : sheet->GetFields() )
for( SCH_FIELD& field : subSheet->GetFields() )
{
if( unresolved( field.GetShownText() ) )
{

View File

@ -1330,20 +1330,16 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
}
bool forceKeepAnnotations = false;
bool forceDropAnnotations = true;
bool dropAnnotations = false;
bool dropAnnotations = true;
if( aEvent.IsAction( &ACTIONS::pasteSpecial ) )
{
DIALOG_PASTE_SPECIAL dlg( m_frame, &forceKeepAnnotations, &forceDropAnnotations );
DIALOG_PASTE_SPECIAL dlg( m_frame, &forceKeepAnnotations );
if( dlg.ShowModal() == wxID_CANCEL )
return 0;
}
if( forceDropAnnotations )
dropAnnotations = true;
// SCH_SEXP_PLUGIN added the items to the paste screen, but not to the view or anything
// else. Pull them back out to start with.
//
@ -1481,7 +1477,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
// reference default value and takes the latest displayed value
existingScreen->EnsureAlternateReferencesExist();
if( forceDropAnnotations || dropSheetAnnotations )
if( dropSheetAnnotations )
existingScreen->ClearAnnotation( &sheetpath );
}
else

View File

@ -39,15 +39,15 @@ public:
wxWindow* aParent = NULL, bool aIndeterminateTaskBarStatus = false,
int aStyle = wxPD_APP_MODAL | wxPD_AUTO_HIDE );
virtual bool Update(
int aValue, const wxString& aNewMsg = wxEmptyString, bool* aSkip = NULL ) override;
virtual bool Update( int aValue, const wxString& aNewMsg = wxEmptyString,
bool* aSkip = NULL ) override;
private:
#if wxCHECK_VERSION( 3, 1, 0 )
wxAppProgressIndicator m_appProgressIndicator;
#endif
bool m_indeterminateTaskBarStatus;
#endif
};
#endif

View File

@ -198,10 +198,6 @@ class NETLIST
/// Remove footprints from #BOARD not found in netlist when true.
bool m_deleteExtraFootprints;
/// Do not actually make any changes. Only report changes to #BOARD from netlist
/// when true.
bool m_isDryRun;
/// Find component by time stamp if true or reference designator if false.
bool m_findByTimeStamp;
@ -211,7 +207,6 @@ class NETLIST
public:
NETLIST() :
m_deleteExtraFootprints( false ),
m_isDryRun( false ),
m_findByTimeStamp( false ),
m_replaceFootprints( false )
{