diff --git a/plugins/samplesource/bladerf/bladerfgui.cpp b/plugins/samplesource/bladerf/bladerfgui.cpp index 3e1a2d905..553058e49 100644 --- a/plugins/samplesource/bladerf/bladerfgui.cpp +++ b/plugins/samplesource/bladerf/bladerfgui.cpp @@ -20,7 +20,6 @@ #include #include "ui_bladerfgui.h" -#include "plugin/pluginapi.h" #include "device/deviceapi.h" #include "gui/colormapper.h" #include "gui/glspectrum.h" @@ -29,10 +28,9 @@ #include "dsp/filesink.h" #include "bladerfgui.h" -BladerfGui::BladerfGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) : +BladerfGui::BladerfGui(DeviceAPI *deviceAPI, QWidget* parent) : QWidget(parent), ui(new Ui::BladerfGui), - m_pluginAPI(pluginAPI), m_deviceAPI(deviceAPI), m_settings(), m_sampleSource(NULL), diff --git a/plugins/samplesource/bladerf/bladerfgui.h b/plugins/samplesource/bladerf/bladerfgui.h index a743f8377..425908932 100644 --- a/plugins/samplesource/bladerf/bladerfgui.h +++ b/plugins/samplesource/bladerf/bladerfgui.h @@ -22,7 +22,6 @@ #include "bladerfinput.h" -class PluginAPI; class DeviceAPI; class FileSink; @@ -35,7 +34,7 @@ class BladerfGui : public QWidget, public PluginGUI { Q_OBJECT public: - explicit BladerfGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL); + explicit BladerfGui(DeviceAPI *deviceAPI, QWidget* parent = NULL); virtual ~BladerfGui(); void destroy(); @@ -52,7 +51,6 @@ public: private: Ui::BladerfGui* ui; - PluginAPI* m_pluginAPI; DeviceAPI* m_deviceAPI; BladeRFSettings m_settings; QTimer m_updateTimer; diff --git a/plugins/samplesource/bladerf/bladerfplugin.cpp b/plugins/samplesource/bladerf/bladerfplugin.cpp index e98fbf505..6473ebaff 100644 --- a/plugins/samplesource/bladerf/bladerfplugin.cpp +++ b/plugins/samplesource/bladerf/bladerfplugin.cpp @@ -35,8 +35,7 @@ const PluginDescriptor BlderfPlugin::m_pluginDescriptor = { const QString BlderfPlugin::m_deviceTypeID = BLADERF_DEVICE_TYPE_ID; BlderfPlugin::BlderfPlugin(QObject* parent) : - QObject(parent), - m_pluginAPI(0) + QObject(parent) { } @@ -47,8 +46,7 @@ const PluginDescriptor& BlderfPlugin::getPluginDescriptor() const void BlderfPlugin::initPlugin(PluginAPI* pluginAPI) { - m_pluginAPI = pluginAPI; - m_pluginAPI->registerSampleSource(m_deviceTypeID, this); + pluginAPI->registerSampleSource(m_deviceTypeID, this); } PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources() @@ -78,14 +76,9 @@ PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources() PluginGUI* BlderfPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceAPI *deviceAPI) { - if (!m_pluginAPI) - { - return 0; - } - if(sourceId == m_deviceTypeID) { - BladerfGui* gui = new BladerfGui(m_pluginAPI, deviceAPI); + BladerfGui* gui = new BladerfGui(deviceAPI); *widget = gui; return gui; } diff --git a/plugins/samplesource/bladerf/bladerfplugin.h b/plugins/samplesource/bladerf/bladerfplugin.h index da4b05f58..539950254 100644 --- a/plugins/samplesource/bladerf/bladerfplugin.h +++ b/plugins/samplesource/bladerf/bladerfplugin.h @@ -20,6 +20,8 @@ #include #include "plugin/plugininterface.h" +class PluginAPI; + #define BLADERF_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf" class BlderfPlugin : public QObject, public PluginInterface { @@ -40,8 +42,6 @@ public: private: static const PluginDescriptor m_pluginDescriptor; - - PluginAPI* m_pluginAPI; }; #endif // INCLUDE_BLADERFPLUGIN_H