1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

gadgetWidget's destructor now gets called OK.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2645 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2011-01-31 22:39:06 +00:00 committed by pip
parent 0a87ed23c7
commit 5f07a95234
3 changed files with 63 additions and 52 deletions

View File

@ -1,49 +1,48 @@
/**
******************************************************************************
*
* @file pipxtremegadget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @{
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "pipxtremegadget.h"
#include "pipxtremegadgetwidget.h"
#include "pipxtremegadgetconfiguration.h"
PipXtremeGadget::PipXtremeGadget(QString classId, PipXtremeGadgetWidget *widget, QWidget *parent) :
IUAVGadget(classId, parent),
m_widget(widget)
{
}
PipXtremeGadget::~PipXtremeGadget()
{
}
/**
* Loads a configuration.
*
*/
void PipXtremeGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{
Q_UNUSED(config);
/* PipXtremeGadgetConfiguration *m = qobject_cast< PipXtremeGadgetConfiguration*>(config);
*/
}
/**
******************************************************************************
*
* @file pipxtremegadget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @{
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "pipxtremegadget.h"
#include "pipxtremegadgetwidget.h"
#include "pipxtremegadgetconfiguration.h"
PipXtremeGadget::PipXtremeGadget(QString classId, PipXtremeGadgetWidget *widget, QWidget *parent) :
IUAVGadget(classId, parent),
m_widget(widget)
{
}
PipXtremeGadget::~PipXtremeGadget()
{
delete m_widget;
m_widget = NULL;
}
// Loads a configuration.
void PipXtremeGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{
Q_UNUSED(config);
/* PipXtremeGadgetConfiguration *m = qobject_cast< PipXtremeGadgetConfiguration*>(config);
*/
}

View File

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

View File

@ -28,6 +28,8 @@
#include <coreplugin/iuavgadgetfactory.h>
#include "pipxtremegadgetwidget.h"
namespace Core {
class IUAVGadget;
class IUAVGadgetFactory;
@ -46,6 +48,9 @@ public:
IUAVGadgetConfiguration * createConfiguration(QSettings *qSettings);
IOptionsPage * createOptionsPage(IUAVGadgetConfiguration *config);
protected:
PipXtremeGadgetWidget *gadgetWidget;
};
#endif