diff --git a/pcbnew/action_plugin.cpp b/pcbnew/action_plugin.cpp index bfb70fcca6..375009c15d 100644 --- a/pcbnew/action_plugin.cpp +++ b/pcbnew/action_plugin.cpp @@ -159,6 +159,7 @@ void ACTION_PLUGINS::register_action( ACTION_PLUGIN* aAction ) // Load icon if supplied wxString icon_file_name = aAction->GetIconFileName( GetBitmapStore()->IsDarkTheme() ); + if( !icon_file_name.IsEmpty() ) { { diff --git a/pcbnew/action_plugin.h b/pcbnew/action_plugin.h index 4ad815d45e..66b50771b2 100644 --- a/pcbnew/action_plugin.h +++ b/pcbnew/action_plugin.h @@ -83,10 +83,10 @@ public: /** * Function GetIconFileName - * @param dark true if requesting dark theme icon + * @param aDark true if requesting dark theme icon * @return a path to icon for the action plugin button */ - virtual wxString GetIconFileName( bool dark ) = 0; + virtual wxString GetIconFileName( bool aDark ) = 0; /** * Function GetPluginPath diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/swig/pcbnew_action_plugins.cpp index 07649bd3b3..fc2c169470 100644 --- a/pcbnew/swig/pcbnew_action_plugins.cpp +++ b/pcbnew/swig/pcbnew_action_plugins.cpp @@ -138,11 +138,11 @@ bool PYTHON_ACTION_PLUGIN::GetShowToolbarButton() } -wxString PYTHON_ACTION_PLUGIN::GetIconFileName( bool dark ) +wxString PYTHON_ACTION_PLUGIN::GetIconFileName( bool aDark ) { PyLOCK lock; - PyObject* arglist = Py_BuildValue( "(i)", (int) dark ); + PyObject* arglist = Py_BuildValue( "(i)", static_cast( aDark ) ); wxString result = CallRetStrMethod( "GetIconFileName", arglist ); diff --git a/pcbnew/swig/pcbnew_action_plugins.h b/pcbnew/swig/pcbnew_action_plugins.h index 5c65072179..ab7266b45d 100644 --- a/pcbnew/swig/pcbnew_action_plugins.h +++ b/pcbnew/swig/pcbnew_action_plugins.h @@ -52,7 +52,7 @@ public: wxString GetName() override; wxString GetDescription() override; bool GetShowToolbarButton() override; - wxString GetIconFileName( bool dark ) override; + wxString GetIconFileName( bool aDark ) override; wxString GetPluginPath() override; void Run() override; void* GetObject() override;