Commit ab25a46a authored by DonLakeFlyer's avatar DonLakeFlyer

Fix crash on exit due to bad parenting/shutdown sequence

parent 4928cccf
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "QGCMAVLink.h" #include "QGCMAVLink.h"
#include <QtQml> #include <QtQml>
#include <QQmlEngine>
Fact::Fact(QObject* parent) Fact::Fact(QObject* parent)
: QObject(parent) : QObject(parent)
...@@ -27,6 +28,9 @@ Fact::Fact(QObject* parent) ...@@ -27,6 +28,9 @@ Fact::Fact(QObject* parent)
{ {
FactMetaData* metaData = new FactMetaData(_type, this); FactMetaData* metaData = new FactMetaData(_type, this);
setMetaData(metaData); setMetaData(metaData);
// Better sage than sorry on object ownership
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
} }
Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObject* parent) Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObject* parent)
...@@ -41,12 +45,14 @@ Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObjec ...@@ -41,12 +45,14 @@ Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObjec
{ {
FactMetaData* metaData = new FactMetaData(_type, this); FactMetaData* metaData = new FactMetaData(_type, this);
setMetaData(metaData); setMetaData(metaData);
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
} }
Fact::Fact(const Fact& other, QObject* parent) Fact::Fact(const Fact& other, QObject* parent)
: QObject(parent) : QObject(parent)
{ {
*this = other; *this = other;
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
} }
const Fact& Fact::operator=(const Fact& other) const Fact& Fact::operator=(const Fact& other)
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
const char* FactSystem::_factSystemQmlUri = "QGroundControl.FactSystem"; const char* FactSystem::_factSystemQmlUri = "QGroundControl.FactSystem";
FactSystem::FactSystem(QGCApplication* app) FactSystem::FactSystem(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
{ {
} }
......
...@@ -31,7 +31,7 @@ class FactSystem : public QGCTool ...@@ -31,7 +31,7 @@ class FactSystem : public QGCTool
public: public:
/// All access to FactSystem is through FactSystem::instance, so constructor is private /// All access to FactSystem is through FactSystem::instance, so constructor is private
FactSystem(QGCApplication* app); FactSystem(QGCApplication* app, QGCToolbox* toolbox);
// Override from QGCTool // Override from QGCTool
virtual void setToolbox(QGCToolbox *toolbox); virtual void setToolbox(QGCToolbox *toolbox);
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "FirmwarePluginManager.h" #include "FirmwarePluginManager.h"
#include "FirmwarePlugin.h" #include "FirmwarePlugin.h"
FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app) FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _genericFirmwarePlugin(NULL) , _genericFirmwarePlugin(NULL)
{ {
......
...@@ -29,7 +29,7 @@ class FirmwarePluginManager : public QGCTool ...@@ -29,7 +29,7 @@ class FirmwarePluginManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
FirmwarePluginManager(QGCApplication* app); FirmwarePluginManager(QGCApplication* app, QGCToolbox* toolbox);
~FirmwarePluginManager(); ~FirmwarePluginManager();
/// Returns list of firmwares which are supported by the system /// Returns list of firmwares which are supported by the system
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
QGC_LOGGING_CATEGORY(VideoManagerLog, "VideoManagerLog") QGC_LOGGING_CATEGORY(VideoManagerLog, "VideoManagerLog")
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
VideoManager::VideoManager(QGCApplication* app) VideoManager::VideoManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _videoSurface(NULL) , _videoSurface(NULL)
, _videoReceiver(NULL) , _videoReceiver(NULL)
, _videoRunning(false) , _videoRunning(false)
......
...@@ -29,7 +29,7 @@ class VideoManager : public QGCTool ...@@ -29,7 +29,7 @@ class VideoManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
VideoManager (QGCApplication* app); VideoManager (QGCApplication* app, QGCToolbox* toolbox);
~VideoManager (); ~VideoManager ();
Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged) Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged)
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "Vehicle.h" #include "Vehicle.h"
#include "PositionManager.h" #include "PositionManager.h"
FollowMe::FollowMe(QGCApplication* app) FollowMe::FollowMe(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app), estimatation_capabilities(0) : QGCTool(app, toolbox), estimatation_capabilities(0)
{ {
memset(&_motionReport, 0, sizeof(motionReport_s)); memset(&_motionReport, 0, sizeof(motionReport_s));
runTime.start(); runTime.start();
...@@ -27,11 +27,6 @@ FollowMe::FollowMe(QGCApplication* app) ...@@ -27,11 +27,6 @@ FollowMe::FollowMe(QGCApplication* app)
connect(&_gcsMotionReportTimer, &QTimer::timeout, this, &FollowMe::_sendGCSMotionReport); connect(&_gcsMotionReportTimer, &QTimer::timeout, this, &FollowMe::_sendGCSMotionReport);
} }
FollowMe::~FollowMe()
{
_disable();
}
void FollowMe::followMeHandleManager(const QString&) void FollowMe::followMeHandleManager(const QString&)
{ {
QmlObjectListModel & vehicles = *_toolbox->multiVehicleManager()->vehicles(); QmlObjectListModel & vehicles = *_toolbox->multiVehicleManager()->vehicles();
......
...@@ -27,8 +27,7 @@ class FollowMe : public QGCTool ...@@ -27,8 +27,7 @@ class FollowMe : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
FollowMe(QGCApplication* app); FollowMe(QGCApplication* app, QGCToolbox* toolbox);
~FollowMe();
public slots: public slots:
void followMeHandleManager(const QString&); void followMeHandleManager(const QString&);
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include <QtAndroidExtras/QAndroidJniObject> #include <QtAndroidExtras/QAndroidJniObject>
#endif #endif
GAudioOutput::GAudioOutput(QGCApplication* app) GAudioOutput::GAudioOutput(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
#ifndef __android__ #ifndef __android__
, thread(new QThread()) , thread(new QThread())
, worker(new QGCAudioWorker()) , worker(new QGCAudioWorker())
......
...@@ -39,7 +39,7 @@ class GAudioOutput : public QGCTool ...@@ -39,7 +39,7 @@ class GAudioOutput : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
GAudioOutput(QGCApplication* app); GAudioOutput(QGCApplication* app, QGCToolbox* toolbox);
~GAudioOutput(); ~GAudioOutput();
/** @brief List available voices */ /** @brief List available voices */
......
...@@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(JoystickManagerLog, "JoystickManagerLog") ...@@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(JoystickManagerLog, "JoystickManagerLog")
const char * JoystickManager::_settingsGroup = "JoystickManager"; const char * JoystickManager::_settingsGroup = "JoystickManager";
const char * JoystickManager::_settingsKeyActiveJoystick = "ActiveJoystick"; const char * JoystickManager::_settingsKeyActiveJoystick = "ActiveJoystick";
JoystickManager::JoystickManager(QGCApplication* app) JoystickManager::JoystickManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _activeJoystick(NULL) , _activeJoystick(NULL)
, _multiVehicleManager(NULL) , _multiVehicleManager(NULL)
{ {
......
...@@ -25,7 +25,7 @@ class JoystickManager : public QGCTool ...@@ -25,7 +25,7 @@ class JoystickManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
JoystickManager(QGCApplication* app); JoystickManager(QGCApplication* app, QGCToolbox* toolbox);
~JoystickManager(); ~JoystickManager();
/// List of available joysticks /// List of available joysticks
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <QQmlEngine> #include <QQmlEngine>
MissionCommandTree::MissionCommandTree(QGCApplication* app, bool unitTest) MissionCommandTree::MissionCommandTree(QGCApplication* app, QGCToolbox* toolbox, bool unitTest)
: QGCTool(app) : QGCTool(app, toolbox)
, _allCommandsCategory(tr("All commands")) , _allCommandsCategory(tr("All commands"))
, _settingsManager(NULL) , _settingsManager(NULL)
, _unitTest(unitTest) , _unitTest(unitTest)
......
...@@ -48,7 +48,7 @@ class MissionCommandTree : public QGCTool ...@@ -48,7 +48,7 @@ class MissionCommandTree : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
MissionCommandTree(QGCApplication* app, bool unitTest = false); MissionCommandTree(QGCApplication* app, QGCToolbox* toolbox, bool unitTest = false);
/// Returns the friendly name for the specified command /// Returns the friendly name for the specified command
QString friendlyName(MAV_CMD command); QString friendlyName(MAV_CMD command);
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCCorePlugin.h" #include "QGCCorePlugin.h"
QGCPositionManager::QGCPositionManager(QGCApplication* app) : QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox)
QGCTool(app), : QGCTool(app, toolbox)
_updateInterval(0), , _updateInterval(0)
_currentSource(nullptr) , _currentSource(nullptr)
{ {
} }
......
...@@ -21,7 +21,7 @@ class QGCPositionManager : public QGCTool { ...@@ -21,7 +21,7 @@ class QGCPositionManager : public QGCTool {
public: public:
QGCPositionManager(QGCApplication* app); QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox);
~QGCPositionManager(); ~QGCPositionManager();
enum QGCPositionSource { enum QGCPositionSource {
......
...@@ -133,7 +133,7 @@ static QObject* mavlinkQmlSingletonFactory(QQmlEngine*, QJSEngine*) ...@@ -133,7 +133,7 @@ static QObject* mavlinkQmlSingletonFactory(QQmlEngine*, QJSEngine*)
static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*) static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
{ {
// We create this object as a QGCTool even though it isn't in the toolbox // We create this object as a QGCTool even though it isn't in the toolbox
QGroundControlQmlGlobal* qmlGlobal = new QGroundControlQmlGlobal(qgcApp()); QGroundControlQmlGlobal* qmlGlobal = new QGroundControlQmlGlobal(qgcApp(), qgcApp()->toolbox());
qmlGlobal->setToolbox(qgcApp()->toolbox()); qmlGlobal->setToolbox(qgcApp()->toolbox());
return qmlGlobal; return qmlGlobal;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "QGCCorePlugin.h" #include "QGCCorePlugin.h"
#include "QGCOptions.h" #include "QGCOptions.h"
#include "SettingsManager.h" #include "SettingsManager.h"
#include "QGCApplication.h"
#if defined(QGC_CUSTOM_BUILD) #if defined(QGC_CUSTOM_BUILD)
#include CUSTOMHEADER #include CUSTOMHEADER
...@@ -57,28 +58,28 @@ QGCToolbox::QGCToolbox(QGCApplication* app) ...@@ -57,28 +58,28 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
, _settingsManager(NULL) , _settingsManager(NULL)
{ {
// SettingsManager must be first so settings are available to any subsequent tools // SettingsManager must be first so settings are available to any subsequent tools
_settingsManager = new SettingsManager(app); _settingsManager = new SettingsManager(app, this);
//-- Scan and load plugins //-- Scan and load plugins
_scanAndLoadPlugins(app); _scanAndLoadPlugins(app);
_audioOutput = new GAudioOutput(app); _audioOutput = new GAudioOutput (app, this);
_factSystem = new FactSystem(app); _factSystem = new FactSystem (app, this);
_firmwarePluginManager = new FirmwarePluginManager(app); _firmwarePluginManager = new FirmwarePluginManager (app, this);
#ifndef __mobile__ #ifndef __mobile__
_gpsManager = new GPSManager(app); _gpsManager = new GPSManager (app, this);
#endif #endif
_imageProvider = new QGCImageProvider(app); _imageProvider = new QGCImageProvider (app, this);
_joystickManager = new JoystickManager(app); _joystickManager = new JoystickManager (app, this);
_linkManager = new LinkManager(app); _linkManager = new LinkManager (app, this);
_mavlinkProtocol = new MAVLinkProtocol(app); _mavlinkProtocol = new MAVLinkProtocol (app, this);
_missionCommandTree = new MissionCommandTree(app); _missionCommandTree = new MissionCommandTree (app, this);
_multiVehicleManager = new MultiVehicleManager(app); _multiVehicleManager = new MultiVehicleManager (app, this);
_mapEngineManager = new QGCMapEngineManager(app); _mapEngineManager = new QGCMapEngineManager (app, this);
_uasMessageHandler = new UASMessageHandler(app); _uasMessageHandler = new UASMessageHandler (app, this);
_qgcPositionManager = new QGCPositionManager(app); _qgcPositionManager = new QGCPositionManager (app, this);
_followMe = new FollowMe(app); _followMe = new FollowMe (app, this);
_videoManager = new VideoManager(app); _videoManager = new VideoManager (app, this);
_mavlinkLogManager = new MAVLinkLogManager(app); _mavlinkLogManager = new MAVLinkLogManager (app, this);
} }
void QGCToolbox::setChildToolboxes(void) void QGCToolbox::setChildToolboxes(void)
...@@ -107,40 +108,21 @@ void QGCToolbox::setChildToolboxes(void) ...@@ -107,40 +108,21 @@ void QGCToolbox::setChildToolboxes(void)
_mavlinkLogManager->setToolbox(this); _mavlinkLogManager->setToolbox(this);
} }
QGCToolbox::~QGCToolbox()
{
delete _videoManager;
delete _mavlinkLogManager;
delete _audioOutput;
delete _factSystem;
delete _firmwarePluginManager;
delete _joystickManager;
delete _linkManager;
delete _mavlinkProtocol;
delete _missionCommandTree;
delete _mapEngineManager;
delete _multiVehicleManager;
delete _uasMessageHandler;
delete _followMe;
delete _qgcPositionManager;
delete _corePlugin;
}
void QGCToolbox::_scanAndLoadPlugins(QGCApplication* app) void QGCToolbox::_scanAndLoadPlugins(QGCApplication* app)
{ {
#if defined (QGC_CUSTOM_BUILD) #if defined (QGC_CUSTOM_BUILD)
//-- Create custom plugin (Static) //-- Create custom plugin (Static)
_corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app); _corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app, app->toolbox());
if(_corePlugin) { if(_corePlugin) {
return; return;
} }
#endif #endif
//-- No plugins found, use default instance //-- No plugins found, use default instance
_corePlugin = new QGCCorePlugin(app); _corePlugin = new QGCCorePlugin(app, app->toolbox());
} }
QGCTool::QGCTool(QGCApplication* app) QGCTool::QGCTool(QGCApplication* app, QGCToolbox* toolbox)
: QObject((QObject*)app) : QObject(toolbox)
, _app(app) , _app(app)
, _toolbox(NULL) , _toolbox(NULL)
{ {
......
...@@ -34,11 +34,11 @@ class QGCCorePlugin; ...@@ -34,11 +34,11 @@ class QGCCorePlugin;
class SettingsManager; class SettingsManager;
/// This is used to manage all of our top level services/tools /// This is used to manage all of our top level services/tools
class QGCToolbox { class QGCToolbox : public QObject {
Q_OBJECT
public: public:
QGCToolbox(QGCApplication* app); QGCToolbox(QGCApplication* app);
~QGCToolbox();
FirmwarePluginManager* firmwarePluginManager(void) { return _firmwarePluginManager; } FirmwarePluginManager* firmwarePluginManager(void) { return _firmwarePluginManager; }
GAudioOutput* audioOutput(void) { return _audioOutput; } GAudioOutput* audioOutput(void) { return _audioOutput; }
...@@ -95,11 +95,12 @@ class QGCTool : public QObject { ...@@ -95,11 +95,12 @@ class QGCTool : public QObject {
Q_OBJECT Q_OBJECT
public: public:
// All tools are parented to QGCAppliation and go through a two phase creation. First all tools are newed, // All tools must be parented to the QGCToolbox and go through a two phase creation. In the constructor the toolbox
// and then setToolbox is called on all tools. The prevents creating an circular dependencies at constructor // should only be passed to QGCTool constructor for correct parenting. It should not be referenced or set in the
// time. // protected member. Then in the second phase of setToolbox calls is where you can reference the toolbox.
QGCTool(QGCApplication* app); QGCTool(QGCApplication* app, QGCToolbox* toolbox);
// If you override this method, you must call the base class.
virtual void setToolbox(QGCToolbox* toolbox); virtual void setToolbox(QGCToolbox* toolbox);
protected: protected:
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <QPainter> #include <QPainter>
#include <QFont> #include <QFont>
QGCImageProvider::QGCImageProvider(QGCApplication *app) QGCImageProvider::QGCImageProvider(QGCApplication *app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, QQuickImageProvider(QQmlImageProviderBase::Image) , QQuickImageProvider(QQmlImageProviderBase::Image)
{ {
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
class QGCImageProvider : public QGCTool, public QQuickImageProvider class QGCImageProvider : public QGCTool, public QQuickImageProvider
{ {
public: public:
QGCImageProvider (QGCApplication* app); QGCImageProvider (QGCApplication* app, QGCToolbox* toolbox);
~QGCImageProvider (); ~QGCImageProvider ();
QImage requestImage (const QString & id, QSize * size, const QSize & requestedSize); QImage requestImage (const QString & id, QSize * size, const QSize & requestedSize);
void setImage (QImage* pImage, int id = 0); void setImage (QImage* pImage, int id = 0);
......
...@@ -24,8 +24,8 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLatitudeSettingsKey = ...@@ -24,8 +24,8 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLatitudeSettingsKey =
const char* QGroundControlQmlGlobal::_flightMapPositionLongitudeSettingsKey = "Longitude"; const char* QGroundControlQmlGlobal::_flightMapPositionLongitudeSettingsKey = "Longitude";
const char* QGroundControlQmlGlobal::_flightMapZoomSettingsKey = "FlightMapZoom"; const char* QGroundControlQmlGlobal::_flightMapZoomSettingsKey = "FlightMapZoom";
QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app) QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _flightMapInitialZoom(14.7) // About 500 meter scale , _flightMapInitialZoom(14.7) // About 500 meter scale
, _linkManager(NULL) , _linkManager(NULL)
, _multiVehicleManager(NULL) , _multiVehicleManager(NULL)
......
...@@ -34,7 +34,7 @@ class QGroundControlQmlGlobal : public QGCTool ...@@ -34,7 +34,7 @@ class QGroundControlQmlGlobal : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
QGroundControlQmlGlobal(QGCApplication* app); QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox* toolbox);
~QGroundControlQmlGlobal(); ~QGroundControlQmlGlobal();
Q_PROPERTY(QString appName READ appName CONSTANT) Q_PROPERTY(QString appName READ appName CONSTANT)
......
...@@ -30,8 +30,8 @@ QGC_LOGGING_CATEGORY(QGCMapEngineManagerLog, "QGCMapEngineManagerLog") ...@@ -30,8 +30,8 @@ QGC_LOGGING_CATEGORY(QGCMapEngineManagerLog, "QGCMapEngineManagerLog")
static const char* kQmlOfflineMapKeyName = "QGCOfflineMap"; static const char* kQmlOfflineMapKeyName = "QGCOfflineMap";
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
QGCMapEngineManager::QGCMapEngineManager(QGCApplication* app) QGCMapEngineManager::QGCMapEngineManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _topleftLat(0.0) , _topleftLat(0.0)
, _topleftLon(0.0) , _topleftLon(0.0)
, _bottomRightLat(0.0) , _bottomRightLat(0.0)
......
...@@ -26,7 +26,7 @@ class QGCMapEngineManager : public QGCTool ...@@ -26,7 +26,7 @@ class QGCMapEngineManager : public QGCTool
{ {
Q_OBJECT Q_OBJECT
public: public:
QGCMapEngineManager(QGCApplication* app); QGCMapEngineManager(QGCApplication* app, QGCToolbox* toolbox);
~QGCMapEngineManager(); ~QGCMapEngineManager();
enum ImportAction { enum ImportAction {
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include <QQmlEngine> #include <QQmlEngine>
#include <QtQml> #include <QtQml>
SettingsManager::SettingsManager(QGCApplication* app) SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _appSettings(NULL) , _appSettings(NULL)
, _unitsSettings(NULL) , _unitsSettings(NULL)
, _autoConnectSettings(NULL) , _autoConnectSettings(NULL)
......
...@@ -28,7 +28,7 @@ class SettingsManager : public QGCTool ...@@ -28,7 +28,7 @@ class SettingsManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
SettingsManager(QGCApplication* app); SettingsManager(QGCApplication* app, QGCToolbox* toolbox);
Q_PROPERTY(QObject* appSettings READ appSettings CONSTANT) Q_PROPERTY(QObject* appSettings READ appSettings CONSTANT)
Q_PROPERTY(QObject* unitsSettings READ unitsSettings CONSTANT) Q_PROPERTY(QObject* unitsSettings READ unitsSettings CONSTANT)
......
...@@ -295,8 +295,8 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message, ...@@ -295,8 +295,8 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app) MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _enableAutoUpload(true) , _enableAutoUpload(true)
, _enableAutoStart(false) , _enableAutoStart(false)
, _nam(NULL) , _nam(NULL)
......
...@@ -106,7 +106,7 @@ class MAVLinkLogManager : public QGCTool ...@@ -106,7 +106,7 @@ class MAVLinkLogManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
MAVLinkLogManager (QGCApplication* app); MAVLinkLogManager (QGCApplication* app, QGCToolbox* toolbox);
~MAVLinkLogManager (); ~MAVLinkLogManager ();
Q_PROPERTY(QString emailAddress READ emailAddress WRITE setEmailAddress NOTIFY emailAddressChanged) Q_PROPERTY(QString emailAddress READ emailAddress WRITE setEmailAddress NOTIFY emailAddressChanged)
......
...@@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(MultiVehicleManagerLog, "MultiVehicleManagerLog") ...@@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(MultiVehicleManagerLog, "MultiVehicleManagerLog")
const char* MultiVehicleManager::_gcsHeartbeatEnabledKey = "gcsHeartbeatEnabled"; const char* MultiVehicleManager::_gcsHeartbeatEnabledKey = "gcsHeartbeatEnabled";
MultiVehicleManager::MultiVehicleManager(QGCApplication* app) MultiVehicleManager::MultiVehicleManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _activeVehicleAvailable(false) , _activeVehicleAvailable(false)
, _parameterReadyVehicleAvailable(false) , _parameterReadyVehicleAvailable(false)
, _activeVehicle(NULL) , _activeVehicle(NULL)
......
...@@ -33,7 +33,7 @@ class MultiVehicleManager : public QGCTool ...@@ -33,7 +33,7 @@ class MultiVehicleManager : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
MultiVehicleManager(QGCApplication* app); MultiVehicleManager(QGCApplication* app, QGCToolbox* toolbox);
Q_INVOKABLE void saveSetting (const QString &key, const QString& value); Q_INVOKABLE void saveSetting (const QString &key, const QString& value);
Q_INVOKABLE QString loadSetting (const QString &key, const QString& defaultValue); Q_INVOKABLE QString loadSetting (const QString &key, const QString& defaultValue);
......
...@@ -79,8 +79,8 @@ QGCCorePlugin::~QGCCorePlugin() ...@@ -79,8 +79,8 @@ QGCCorePlugin::~QGCCorePlugin()
} }
} }
QGCCorePlugin::QGCCorePlugin(QGCApplication *app) QGCCorePlugin::QGCCorePlugin(QGCApplication *app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _showTouchAreas(false) , _showTouchAreas(false)
, _showAdvancedUI(true) , _showAdvancedUI(true)
{ {
......
...@@ -31,7 +31,7 @@ class QGCCorePlugin : public QGCTool ...@@ -31,7 +31,7 @@ class QGCCorePlugin : public QGCTool
{ {
Q_OBJECT Q_OBJECT
public: public:
QGCCorePlugin(QGCApplication* app); QGCCorePlugin(QGCApplication* app, QGCToolbox* toolbox);
~QGCCorePlugin(); ~QGCCorePlugin();
Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged) Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged)
......
...@@ -42,8 +42,8 @@ const int LinkManager::_autoconnectConnectDelayMSecs = 6000; ...@@ -42,8 +42,8 @@ const int LinkManager::_autoconnectConnectDelayMSecs = 6000;
const int LinkManager::_autoconnectConnectDelayMSecs = 1000; const int LinkManager::_autoconnectConnectDelayMSecs = 1000;
#endif #endif
LinkManager::LinkManager(QGCApplication* app) LinkManager::LinkManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _configUpdateSuspended(false) , _configUpdateSuspended(false)
, _configurationsLoaded(false) , _configurationsLoaded(false)
, _connectionsSuspended(false) , _connectionsSuspended(false)
......
...@@ -58,7 +58,7 @@ class LinkManager : public QGCTool ...@@ -58,7 +58,7 @@ class LinkManager : public QGCTool
friend class LinkManagerTest; friend class LinkManagerTest;
public: public:
LinkManager(QGCApplication* app); LinkManager(QGCApplication* app, QGCToolbox* toolbox);
~LinkManager(); ~LinkManager();
Q_PROPERTY(bool isBluetoothAvailable READ isBluetoothAvailable CONSTANT) Q_PROPERTY(bool isBluetoothAvailable READ isBluetoothAvailable CONSTANT)
......
...@@ -50,8 +50,8 @@ const char* MAVLinkProtocol::_logFileExtension = "mavlink"; ///< Ext ...@@ -50,8 +50,8 @@ const char* MAVLinkProtocol::_logFileExtension = "mavlink"; ///< Ext
* The default constructor will create a new MAVLink object sending heartbeats at * The default constructor will create a new MAVLink object sending heartbeats at
* the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links. * the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links.
*/ */
MAVLinkProtocol::MAVLinkProtocol(QGCApplication* app) MAVLinkProtocol::MAVLinkProtocol(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, m_enable_version_check(true) , m_enable_version_check(true)
, versionMismatchIgnore(false) , versionMismatchIgnore(false)
, systemId(255) , systemId(255)
......
...@@ -43,7 +43,7 @@ class MAVLinkProtocol : public QGCTool ...@@ -43,7 +43,7 @@ class MAVLinkProtocol : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
MAVLinkProtocol(QGCApplication* app); MAVLinkProtocol(QGCApplication* app, QGCToolbox* toolbox);
~MAVLinkProtocol(); ~MAVLinkProtocol();
/** @brief Get the human-friendly name of this protocol */ /** @brief Get the human-friendly name of this protocol */
......
...@@ -39,8 +39,8 @@ bool UASMessage::severityIsError() ...@@ -39,8 +39,8 @@ bool UASMessage::severityIsError()
} }
} }
UASMessageHandler::UASMessageHandler(QGCApplication* app) UASMessageHandler::UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app) : QGCTool(app, toolbox)
, _activeVehicle(NULL) , _activeVehicle(NULL)
, _activeComponent(-1) , _activeComponent(-1)
, _multiComp(false) , _multiComp(false)
......
...@@ -72,7 +72,7 @@ class UASMessageHandler : public QGCTool ...@@ -72,7 +72,7 @@ class UASMessageHandler : public QGCTool
Q_OBJECT Q_OBJECT
public: public:
explicit UASMessageHandler(QGCApplication* app); explicit UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox);
~UASMessageHandler(); ~UASMessageHandler();
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment