1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-21 11:54:15 +01:00

OP-306 Update all Gadgets so that they destroy their widgets properly when they die.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2681 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2011-02-01 23:01:52 +00:00 committed by edouard
parent a568ff893d
commit 9170155f5f
14 changed files with 868 additions and 884 deletions

View File

@ -36,7 +36,7 @@ ConfigGadget::ConfigGadget(QString classId, ConfigGadgetWidget *widget, QWidget
ConfigGadget::~ConfigGadget()
{
delete m_widget;
}
void ConfigGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -35,5 +35,5 @@ EmptyGadget::EmptyGadget(QString classId, EmptyGadgetWidget *widget, QWidget *pa
EmptyGadget::~EmptyGadget()
{
delete m_widget;
}

View File

@ -54,7 +54,7 @@ GCSControlGadget::GCSControlGadget(QString classId, GCSControlGadgetWidget *widg
GCSControlGadget::~GCSControlGadget()
{
delete m_widget;
}
void GCSControlGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -40,6 +40,7 @@ GpsDisplayGadget::GpsDisplayGadget(QString classId, GpsDisplayWidget *widget, QW
GpsDisplayGadget::~GpsDisplayGadget()
{
delete m_widget;
}
/*

View File

@ -38,7 +38,7 @@ HITLGadget::HITLGadget(QString classId, HITLWidget *widget, QWidget *parent) :
HITLGadget::~HITLGadget()
{
delete m_widget;
}
void HITLGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -39,6 +39,7 @@ ImportExportGadget::ImportExportGadget(QString classId, ImportExportGadgetWidget
ImportExportGadget::~ImportExportGadget()
{
delete m_widget;
}
/*

View File

@ -39,7 +39,7 @@ LoggingGadget::LoggingGadget(QString classId, LoggingGadgetWidget *widget, QWidg
LoggingGadget::~LoggingGadget()
{
delete m_widget;
}
void LoggingGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -40,6 +40,7 @@ MagicWaypointGadget::MagicWaypointGadget(QString classId, MagicWaypointGadgetWid
MagicWaypointGadget::~MagicWaypointGadget()
{
delete m_widget;
}
void MagicWaypointGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -36,7 +36,7 @@ ModelViewGadget::ModelViewGadget(QString classId, ModelViewGadgetWidget *widget,
ModelViewGadget::~ModelViewGadget()
{
delete m_widget;
}
void ModelViewGadget::loadConfiguration(IUAVGadgetConfiguration* config)

View File

@ -36,6 +36,7 @@ OPMapGadget::OPMapGadget(QString classId, OPMapGadgetWidget *widget, QWidget *pa
OPMapGadget::~OPMapGadget()
{
delete m_widget;
}
void OPMapGadget::loadConfiguration(IUAVGadgetConfiguration *config)

View File

@ -32,24 +32,17 @@
#include <coreplugin/iuavgadget.h>
OPMapGadgetFactory::OPMapGadgetFactory(QObject *parent) :
IUAVGadgetFactory(QString("OPMapGadget"), tr("OPMap Gadget"), parent),
gadgetWidget(NULL)
IUAVGadgetFactory(QString("OPMapGadget"), tr("OPMap Gadget"), parent)
{
}
OPMapGadgetFactory::~OPMapGadgetFactory()
{
if (gadgetWidget)
{
delete gadgetWidget;
gadgetWidget = NULL;
}
}
Core::IUAVGadget * OPMapGadgetFactory::createGadget(QWidget *parent)
{
// OPMapGadgetWidget *gadgetWidget = new OPMapGadgetWidget(parent);
gadgetWidget = new OPMapGadgetWidget(parent);
OPMapGadgetWidget *gadgetWidget = new OPMapGadgetWidget(parent);
return new OPMapGadget(QString("OPMapGadget"), gadgetWidget, parent);
}

View File

@ -50,9 +50,6 @@ public:
IUAVGadgetConfiguration *createConfiguration(QSettings* qSettings);
IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config);
protected:
OPMapGadgetWidget *gadgetWidget;
};
#endif // OPMAP_GADGETFACTORY_H_

View File

@ -31,24 +31,17 @@
#include <coreplugin/iuavgadget.h>
PipXtremeGadgetFactory::PipXtremeGadgetFactory(QObject *parent) :
IUAVGadgetFactory(QString("PipXtreme"), tr("PipXtreme Gadget"), parent),
gadgetWidget(NULL)
IUAVGadgetFactory(QString("PipXtreme"), tr("PipXtreme Gadget"), parent)
{
}
PipXtremeGadgetFactory::~PipXtremeGadgetFactory()
{
if (gadgetWidget)
{
delete gadgetWidget;
gadgetWidget = NULL;
}
}
Core::IUAVGadget* PipXtremeGadgetFactory::createGadget(QWidget *parent)
{
// PipXtremeGadgetWidget *gadgetWidget = new PipXtremeGadgetWidget(parent);
gadgetWidget = new PipXtremeGadgetWidget(parent);
PipXtremeGadgetWidget *gadgetWidget = new PipXtremeGadgetWidget(parent);
return new PipXtremeGadget(QString("PipXtreme"), gadgetWidget, parent);
}

View File

@ -48,9 +48,6 @@ public:
IUAVGadgetConfiguration * createConfiguration(QSettings *qSettings);
IOptionsPage * createOptionsPage(IUAVGadgetConfiguration *config);
protected:
PipXtremeGadgetWidget *gadgetWidget;
};
#endif