diff --git a/src/FactSystem/Fact.cc b/src/FactSystem/Fact.cc index 02bc87863f3a83e7cef4d5af375f43174bc2e6ba..234579be4329a359daebec4d657b99a6f1093842 100644 --- a/src/FactSystem/Fact.cc +++ b/src/FactSystem/Fact.cc @@ -15,6 +15,7 @@ #include "QGCMAVLink.h" #include +#include Fact::Fact(QObject* parent) : QObject(parent) @@ -27,6 +28,9 @@ Fact::Fact(QObject* parent) { FactMetaData* metaData = new FactMetaData(_type, this); 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) @@ -41,12 +45,14 @@ Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObjec { FactMetaData* metaData = new FactMetaData(_type, this); setMetaData(metaData); + QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); } Fact::Fact(const Fact& other, QObject* parent) : QObject(parent) { *this = other; + QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); } const Fact& Fact::operator=(const Fact& other) diff --git a/src/FactSystem/FactSystem.cc b/src/FactSystem/FactSystem.cc index 0b9cb3de3b8668536cbce719282f41bc09f23684..146986f2b07039dc90f028c18ff65e681c44cf39 100644 --- a/src/FactSystem/FactSystem.cc +++ b/src/FactSystem/FactSystem.cc @@ -19,8 +19,8 @@ const char* FactSystem::_factSystemQmlUri = "QGroundControl.FactSystem"; -FactSystem::FactSystem(QGCApplication* app) - : QGCTool(app) +FactSystem::FactSystem(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) { } diff --git a/src/FactSystem/FactSystem.h b/src/FactSystem/FactSystem.h index deb1aebec9e8f6baf6b698e8554783e6a7c3931d..e4321cddf09de7b8fe2779bf87e52a69b55e937e 100644 --- a/src/FactSystem/FactSystem.h +++ b/src/FactSystem/FactSystem.h @@ -31,7 +31,7 @@ class FactSystem : public QGCTool public: /// All access to FactSystem is through FactSystem::instance, so constructor is private - FactSystem(QGCApplication* app); + FactSystem(QGCApplication* app, QGCToolbox* toolbox); // Override from QGCTool virtual void setToolbox(QGCToolbox *toolbox); diff --git a/src/FirmwarePlugin/FirmwarePluginManager.cc b/src/FirmwarePlugin/FirmwarePluginManager.cc index 6dd4264dc43a8632d71c49d71212471833b6e7fc..094ac201aaa01f1c1978c603e7e3d679559b302a 100644 --- a/src/FirmwarePlugin/FirmwarePluginManager.cc +++ b/src/FirmwarePlugin/FirmwarePluginManager.cc @@ -14,8 +14,8 @@ #include "FirmwarePluginManager.h" #include "FirmwarePlugin.h" -FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app) - : QGCTool(app) +FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _genericFirmwarePlugin(NULL) { diff --git a/src/FirmwarePlugin/FirmwarePluginManager.h b/src/FirmwarePlugin/FirmwarePluginManager.h index bc1607fe8157f04a4e92e7ecd5a4d7205261b263..30452873bb059e3839fdac331d10b51050b80eda 100644 --- a/src/FirmwarePlugin/FirmwarePluginManager.h +++ b/src/FirmwarePlugin/FirmwarePluginManager.h @@ -29,7 +29,7 @@ class FirmwarePluginManager : public QGCTool Q_OBJECT public: - FirmwarePluginManager(QGCApplication* app); + FirmwarePluginManager(QGCApplication* app, QGCToolbox* toolbox); ~FirmwarePluginManager(); /// Returns list of firmwares which are supported by the system diff --git a/src/FlightDisplay/VideoManager.cc b/src/FlightDisplay/VideoManager.cc index c5c858b593b70ce591dc2f21ccb21d4b39b2b94a..b6c5a83ea6c1de4ccd9a9636158c5c61b6b1a1eb 100644 --- a/src/FlightDisplay/VideoManager.cc +++ b/src/FlightDisplay/VideoManager.cc @@ -30,8 +30,8 @@ QGC_LOGGING_CATEGORY(VideoManagerLog, "VideoManagerLog") //----------------------------------------------------------------------------- -VideoManager::VideoManager(QGCApplication* app) - : QGCTool(app) +VideoManager::VideoManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _videoSurface(NULL) , _videoReceiver(NULL) , _videoRunning(false) diff --git a/src/FlightDisplay/VideoManager.h b/src/FlightDisplay/VideoManager.h index aaffec22e3c3cb52ad18d5fefc512273cd103c2a..162da00b0607519e7b1de2c29b4654ec0dac796a 100644 --- a/src/FlightDisplay/VideoManager.h +++ b/src/FlightDisplay/VideoManager.h @@ -29,7 +29,7 @@ class VideoManager : public QGCTool Q_OBJECT public: - VideoManager (QGCApplication* app); + VideoManager (QGCApplication* app, QGCToolbox* toolbox); ~VideoManager (); Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged) diff --git a/src/FollowMe/FollowMe.cc b/src/FollowMe/FollowMe.cc index 1bb1e188076dc0f455c6df44ac4107ca15267f91..0681ca2bdfddfcd415017e1f152a5733118058a7 100644 --- a/src/FollowMe/FollowMe.cc +++ b/src/FollowMe/FollowMe.cc @@ -17,8 +17,8 @@ #include "Vehicle.h" #include "PositionManager.h" -FollowMe::FollowMe(QGCApplication* app) - : QGCTool(app), estimatation_capabilities(0) +FollowMe::FollowMe(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox), estimatation_capabilities(0) { memset(&_motionReport, 0, sizeof(motionReport_s)); runTime.start(); @@ -27,11 +27,6 @@ FollowMe::FollowMe(QGCApplication* app) connect(&_gcsMotionReportTimer, &QTimer::timeout, this, &FollowMe::_sendGCSMotionReport); } -FollowMe::~FollowMe() -{ - _disable(); -} - void FollowMe::followMeHandleManager(const QString&) { QmlObjectListModel & vehicles = *_toolbox->multiVehicleManager()->vehicles(); diff --git a/src/FollowMe/FollowMe.h b/src/FollowMe/FollowMe.h index c75b5759d362438f955af6991f6fab34d9fb2d0f..541df1112c4ed67f7d2621cef9ea95382f4fad6d 100644 --- a/src/FollowMe/FollowMe.h +++ b/src/FollowMe/FollowMe.h @@ -27,8 +27,7 @@ class FollowMe : public QGCTool Q_OBJECT public: - FollowMe(QGCApplication* app); - ~FollowMe(); + FollowMe(QGCApplication* app, QGCToolbox* toolbox); public slots: void followMeHandleManager(const QString&); diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index b330e782d0388d77ca647dc546c89d92cb93d51d..7d380fbeb1f5ea06c5131de8d95c3f885d6543a4 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -30,8 +30,8 @@ #include #endif -GAudioOutput::GAudioOutput(QGCApplication* app) - : QGCTool(app) +GAudioOutput::GAudioOutput(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) #ifndef __android__ , thread(new QThread()) , worker(new QGCAudioWorker()) diff --git a/src/GAudioOutput.h b/src/GAudioOutput.h index 9a1e40f9df0c032b2a87ae7356e74449001c4868..94b32fb654e1cfbe42c57a57a58ff3cecf6a7072 100644 --- a/src/GAudioOutput.h +++ b/src/GAudioOutput.h @@ -39,7 +39,7 @@ class GAudioOutput : public QGCTool Q_OBJECT public: - GAudioOutput(QGCApplication* app); + GAudioOutput(QGCApplication* app, QGCToolbox* toolbox); ~GAudioOutput(); /** @brief List available voices */ diff --git a/src/Joystick/JoystickManager.cc b/src/Joystick/JoystickManager.cc index 617d414d2554ac45ed3a3a4ee0169035e004159f..e32d399dba6b77162cfd98a6574e0467b0b479dd 100644 --- a/src/Joystick/JoystickManager.cc +++ b/src/Joystick/JoystickManager.cc @@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(JoystickManagerLog, "JoystickManagerLog") const char * JoystickManager::_settingsGroup = "JoystickManager"; const char * JoystickManager::_settingsKeyActiveJoystick = "ActiveJoystick"; -JoystickManager::JoystickManager(QGCApplication* app) - : QGCTool(app) +JoystickManager::JoystickManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _activeJoystick(NULL) , _multiVehicleManager(NULL) { diff --git a/src/Joystick/JoystickManager.h b/src/Joystick/JoystickManager.h index 98a3d09ee2c0f58d3101e5dadd55a77291296b3e..6418886b404868e3fcfe07f39baa785a373b4af1 100644 --- a/src/Joystick/JoystickManager.h +++ b/src/Joystick/JoystickManager.h @@ -25,7 +25,7 @@ class JoystickManager : public QGCTool Q_OBJECT public: - JoystickManager(QGCApplication* app); + JoystickManager(QGCApplication* app, QGCToolbox* toolbox); ~JoystickManager(); /// List of available joysticks diff --git a/src/MissionManager/MissionCommandTree.cc b/src/MissionManager/MissionCommandTree.cc index 9e21355af0bfd82ea05f1b14129371ed317ae851..42254c31e4324f8acb921f2319c3892ef85b6a34 100644 --- a/src/MissionManager/MissionCommandTree.cc +++ b/src/MissionManager/MissionCommandTree.cc @@ -21,8 +21,8 @@ #include -MissionCommandTree::MissionCommandTree(QGCApplication* app, bool unitTest) - : QGCTool(app) +MissionCommandTree::MissionCommandTree(QGCApplication* app, QGCToolbox* toolbox, bool unitTest) + : QGCTool(app, toolbox) , _allCommandsCategory(tr("All commands")) , _settingsManager(NULL) , _unitTest(unitTest) diff --git a/src/MissionManager/MissionCommandTree.h b/src/MissionManager/MissionCommandTree.h index ea892bd103241afa6155dac0967996f9535d14f1..13639b2eec4699193e69105a9b09f85fb13d7d04 100644 --- a/src/MissionManager/MissionCommandTree.h +++ b/src/MissionManager/MissionCommandTree.h @@ -48,7 +48,7 @@ class MissionCommandTree : public QGCTool Q_OBJECT public: - MissionCommandTree(QGCApplication* app, bool unitTest = false); + MissionCommandTree(QGCApplication* app, QGCToolbox* toolbox, bool unitTest = false); /// Returns the friendly name for the specified command QString friendlyName(MAV_CMD command); diff --git a/src/PositionManager/PositionManager.cpp b/src/PositionManager/PositionManager.cpp index b76258dcc0d9075d6afbdbd3d1049b103e2fa36c..b9517922ad0bf734c1976ceffe586d7709ab37d4 100644 --- a/src/PositionManager/PositionManager.cpp +++ b/src/PositionManager/PositionManager.cpp @@ -11,10 +11,10 @@ #include "QGCApplication.h" #include "QGCCorePlugin.h" -QGCPositionManager::QGCPositionManager(QGCApplication* app) : - QGCTool(app), - _updateInterval(0), - _currentSource(nullptr) +QGCPositionManager::QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) + , _updateInterval(0) + , _currentSource(nullptr) { } diff --git a/src/PositionManager/PositionManager.h b/src/PositionManager/PositionManager.h index 334d55b7a856dfb518ffb3720d148b4af9247fab..59a8c5e5070d1bb67af37aa56b6cf4e094327b5f 100644 --- a/src/PositionManager/PositionManager.h +++ b/src/PositionManager/PositionManager.h @@ -21,7 +21,7 @@ class QGCPositionManager : public QGCTool { public: - QGCPositionManager(QGCApplication* app); + QGCPositionManager(QGCApplication* app, QGCToolbox* toolbox); ~QGCPositionManager(); enum QGCPositionSource { diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 7bc96582be5adea9a82cb113e9ce8e95f120baae..c9d5e2a666a5f1d133ddd994f86f626d11f38484 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -133,7 +133,7 @@ static QObject* mavlinkQmlSingletonFactory(QQmlEngine*, QJSEngine*) static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*) { // 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()); return qmlGlobal; diff --git a/src/QGCToolbox.cc b/src/QGCToolbox.cc index d6371bdf66119a5fb3d565f2a5e26e028d052582..92f43eb3ada4212017aab973970116a6166c957a 100644 --- a/src/QGCToolbox.cc +++ b/src/QGCToolbox.cc @@ -29,6 +29,7 @@ #include "QGCCorePlugin.h" #include "QGCOptions.h" #include "SettingsManager.h" +#include "QGCApplication.h" #if defined(QGC_CUSTOM_BUILD) #include CUSTOMHEADER @@ -57,28 +58,28 @@ QGCToolbox::QGCToolbox(QGCApplication* app) , _settingsManager(NULL) { // 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 _scanAndLoadPlugins(app); - _audioOutput = new GAudioOutput(app); - _factSystem = new FactSystem(app); - _firmwarePluginManager = new FirmwarePluginManager(app); + _audioOutput = new GAudioOutput (app, this); + _factSystem = new FactSystem (app, this); + _firmwarePluginManager = new FirmwarePluginManager (app, this); #ifndef __mobile__ - _gpsManager = new GPSManager(app); + _gpsManager = new GPSManager (app, this); #endif - _imageProvider = new QGCImageProvider(app); - _joystickManager = new JoystickManager(app); - _linkManager = new LinkManager(app); - _mavlinkProtocol = new MAVLinkProtocol(app); - _missionCommandTree = new MissionCommandTree(app); - _multiVehicleManager = new MultiVehicleManager(app); - _mapEngineManager = new QGCMapEngineManager(app); - _uasMessageHandler = new UASMessageHandler(app); - _qgcPositionManager = new QGCPositionManager(app); - _followMe = new FollowMe(app); - _videoManager = new VideoManager(app); - _mavlinkLogManager = new MAVLinkLogManager(app); + _imageProvider = new QGCImageProvider (app, this); + _joystickManager = new JoystickManager (app, this); + _linkManager = new LinkManager (app, this); + _mavlinkProtocol = new MAVLinkProtocol (app, this); + _missionCommandTree = new MissionCommandTree (app, this); + _multiVehicleManager = new MultiVehicleManager (app, this); + _mapEngineManager = new QGCMapEngineManager (app, this); + _uasMessageHandler = new UASMessageHandler (app, this); + _qgcPositionManager = new QGCPositionManager (app, this); + _followMe = new FollowMe (app, this); + _videoManager = new VideoManager (app, this); + _mavlinkLogManager = new MAVLinkLogManager (app, this); } void QGCToolbox::setChildToolboxes(void) @@ -107,40 +108,21 @@ void QGCToolbox::setChildToolboxes(void) _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) { #if defined (QGC_CUSTOM_BUILD) //-- Create custom plugin (Static) - _corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app); + _corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app, app->toolbox()); if(_corePlugin) { return; } #endif //-- No plugins found, use default instance - _corePlugin = new QGCCorePlugin(app); + _corePlugin = new QGCCorePlugin(app, app->toolbox()); } -QGCTool::QGCTool(QGCApplication* app) - : QObject((QObject*)app) +QGCTool::QGCTool(QGCApplication* app, QGCToolbox* toolbox) + : QObject(toolbox) , _app(app) , _toolbox(NULL) { diff --git a/src/QGCToolbox.h b/src/QGCToolbox.h index 85d6a615191845c1e77f8466263cbc9b38e24bd4..fb5c2306a3443588030e715452692a0465775e96 100644 --- a/src/QGCToolbox.h +++ b/src/QGCToolbox.h @@ -34,11 +34,11 @@ class QGCCorePlugin; class SettingsManager; /// This is used to manage all of our top level services/tools -class QGCToolbox { +class QGCToolbox : public QObject { + Q_OBJECT public: QGCToolbox(QGCApplication* app); - ~QGCToolbox(); FirmwarePluginManager* firmwarePluginManager(void) { return _firmwarePluginManager; } GAudioOutput* audioOutput(void) { return _audioOutput; } @@ -95,11 +95,12 @@ class QGCTool : public QObject { Q_OBJECT public: - // All tools are parented to QGCAppliation and go through a two phase creation. First all tools are newed, - // and then setToolbox is called on all tools. The prevents creating an circular dependencies at constructor - // time. - QGCTool(QGCApplication* app); + // All tools must be parented to the QGCToolbox and go through a two phase creation. In the constructor the toolbox + // should only be passed to QGCTool constructor for correct parenting. It should not be referenced or set in the + // protected member. Then in the second phase of setToolbox calls is where you can reference the toolbox. + QGCTool(QGCApplication* app, QGCToolbox* toolbox); + // If you override this method, you must call the base class. virtual void setToolbox(QGCToolbox* toolbox); protected: diff --git a/src/QmlControls/QGCImageProvider.cc b/src/QmlControls/QGCImageProvider.cc index 48ac0dd7b2912cf97a6dc8ce05ef150010de6765..0d6ed3b18125341bb0c6a64e5f1d3ab6fa884be5 100644 --- a/src/QmlControls/QGCImageProvider.cc +++ b/src/QmlControls/QGCImageProvider.cc @@ -22,8 +22,8 @@ #include #include -QGCImageProvider::QGCImageProvider(QGCApplication *app) - : QGCTool(app) +QGCImageProvider::QGCImageProvider(QGCApplication *app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , QQuickImageProvider(QQmlImageProviderBase::Image) { } diff --git a/src/QmlControls/QGCImageProvider.h b/src/QmlControls/QGCImageProvider.h index 34dcedb3acac3c50b25e4d850890145f943ca0c8..e30157beb0547802a0e107c584ba758e80b0fba0 100644 --- a/src/QmlControls/QGCImageProvider.h +++ b/src/QmlControls/QGCImageProvider.h @@ -29,7 +29,7 @@ class QGCImageProvider : public QGCTool, public QQuickImageProvider { public: - QGCImageProvider (QGCApplication* app); + QGCImageProvider (QGCApplication* app, QGCToolbox* toolbox); ~QGCImageProvider (); QImage requestImage (const QString & id, QSize * size, const QSize & requestedSize); void setImage (QImage* pImage, int id = 0); diff --git a/src/QmlControls/QGroundControlQmlGlobal.cc b/src/QmlControls/QGroundControlQmlGlobal.cc index 4856844c28cb00a2ec4819aee0ddab44bb133731..4fbce6a3204ff968436c460394ae571e9b79bd0d 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.cc +++ b/src/QmlControls/QGroundControlQmlGlobal.cc @@ -24,8 +24,8 @@ const char* QGroundControlQmlGlobal::_flightMapPositionLatitudeSettingsKey = const char* QGroundControlQmlGlobal::_flightMapPositionLongitudeSettingsKey = "Longitude"; const char* QGroundControlQmlGlobal::_flightMapZoomSettingsKey = "FlightMapZoom"; -QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app) - : QGCTool(app) +QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _flightMapInitialZoom(14.7) // About 500 meter scale , _linkManager(NULL) , _multiVehicleManager(NULL) diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h index 7890513ca32c92fa2253e540b7ae14b83c20de06..70f4abd4a250abf34508b9e7b606ef6554deee1d 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.h +++ b/src/QmlControls/QGroundControlQmlGlobal.h @@ -34,7 +34,7 @@ class QGroundControlQmlGlobal : public QGCTool Q_OBJECT public: - QGroundControlQmlGlobal(QGCApplication* app); + QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox* toolbox); ~QGroundControlQmlGlobal(); Q_PROPERTY(QString appName READ appName CONSTANT) diff --git a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc index 3ed439fd3fb02fce08c0ac1b08e2d941e7d3e280..21f0a4692c924b0e2313a731a3c3840f7aecf58f 100644 --- a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc +++ b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc @@ -30,8 +30,8 @@ QGC_LOGGING_CATEGORY(QGCMapEngineManagerLog, "QGCMapEngineManagerLog") static const char* kQmlOfflineMapKeyName = "QGCOfflineMap"; //----------------------------------------------------------------------------- -QGCMapEngineManager::QGCMapEngineManager(QGCApplication* app) - : QGCTool(app) +QGCMapEngineManager::QGCMapEngineManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _topleftLat(0.0) , _topleftLon(0.0) , _bottomRightLat(0.0) diff --git a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h index 7efe5c6df6534c7e987d650bda348dc8417e5e6b..a0c640ad8822b414a18bc6405ccfe801dc03ff78 100644 --- a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h +++ b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h @@ -26,7 +26,7 @@ class QGCMapEngineManager : public QGCTool { Q_OBJECT public: - QGCMapEngineManager(QGCApplication* app); + QGCMapEngineManager(QGCApplication* app, QGCToolbox* toolbox); ~QGCMapEngineManager(); enum ImportAction { diff --git a/src/Settings/SettingsManager.cc b/src/Settings/SettingsManager.cc index 11f913e8b9f6845a2f4a1c019042b86d85405266..6c5c1a4f63fe57fe66f4491e9f281b769b74ec28 100644 --- a/src/Settings/SettingsManager.cc +++ b/src/Settings/SettingsManager.cc @@ -12,8 +12,8 @@ #include #include -SettingsManager::SettingsManager(QGCApplication* app) - : QGCTool(app) +SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _appSettings(NULL) , _unitsSettings(NULL) , _autoConnectSettings(NULL) diff --git a/src/Settings/SettingsManager.h b/src/Settings/SettingsManager.h index ec65d9bd13762d20c48f711828ec96e4fe2812f3..c56b61d43ddef5c53ccf8065c27a97752d5e429c 100644 --- a/src/Settings/SettingsManager.h +++ b/src/Settings/SettingsManager.h @@ -28,7 +28,7 @@ class SettingsManager : public QGCTool Q_OBJECT public: - SettingsManager(QGCApplication* app); + SettingsManager(QGCApplication* app, QGCToolbox* toolbox); Q_PROPERTY(QObject* appSettings READ appSettings CONSTANT) Q_PROPERTY(QObject* unitsSettings READ unitsSettings CONSTANT) diff --git a/src/Vehicle/MAVLinkLogManager.cc b/src/Vehicle/MAVLinkLogManager.cc index 8a1a64c376009631090fa841bf1bd7e6b6dff83f..ca56c1ff1b50a3ff4a6abdecbdecd520976f30ac 100644 --- a/src/Vehicle/MAVLinkLogManager.cc +++ b/src/Vehicle/MAVLinkLogManager.cc @@ -295,8 +295,8 @@ MAVLinkLogProcessor::processStreamData(uint16_t sequence, uint8_t first_message, //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app) - : QGCTool(app) +MAVLinkLogManager::MAVLinkLogManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _enableAutoUpload(true) , _enableAutoStart(false) , _nam(NULL) diff --git a/src/Vehicle/MAVLinkLogManager.h b/src/Vehicle/MAVLinkLogManager.h index a64b8998f724403405ad8241edc0cf0c6f4e5ba6..bd511932df2044c6ca8b7780bc18740f9e348b26 100644 --- a/src/Vehicle/MAVLinkLogManager.h +++ b/src/Vehicle/MAVLinkLogManager.h @@ -106,7 +106,7 @@ class MAVLinkLogManager : public QGCTool Q_OBJECT public: - MAVLinkLogManager (QGCApplication* app); + MAVLinkLogManager (QGCApplication* app, QGCToolbox* toolbox); ~MAVLinkLogManager (); Q_PROPERTY(QString emailAddress READ emailAddress WRITE setEmailAddress NOTIFY emailAddressChanged) diff --git a/src/Vehicle/MultiVehicleManager.cc b/src/Vehicle/MultiVehicleManager.cc index ef4fddeb1d05bb017b70dc52f9dfc6ebd717bc92..23eb01f2bdc266065d2f778f269ed1829a2c5ec6 100644 --- a/src/Vehicle/MultiVehicleManager.cc +++ b/src/Vehicle/MultiVehicleManager.cc @@ -27,8 +27,8 @@ QGC_LOGGING_CATEGORY(MultiVehicleManagerLog, "MultiVehicleManagerLog") const char* MultiVehicleManager::_gcsHeartbeatEnabledKey = "gcsHeartbeatEnabled"; -MultiVehicleManager::MultiVehicleManager(QGCApplication* app) - : QGCTool(app) +MultiVehicleManager::MultiVehicleManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _activeVehicleAvailable(false) , _parameterReadyVehicleAvailable(false) , _activeVehicle(NULL) diff --git a/src/Vehicle/MultiVehicleManager.h b/src/Vehicle/MultiVehicleManager.h index c8d5e31349a4aa2b512c54f0ae0026adc6c5d4c9..3e209e45c8a818b25ac211814f08325cb9feae01 100644 --- a/src/Vehicle/MultiVehicleManager.h +++ b/src/Vehicle/MultiVehicleManager.h @@ -33,7 +33,7 @@ class MultiVehicleManager : public QGCTool Q_OBJECT public: - MultiVehicleManager(QGCApplication* app); + MultiVehicleManager(QGCApplication* app, QGCToolbox* toolbox); Q_INVOKABLE void saveSetting (const QString &key, const QString& value); Q_INVOKABLE QString loadSetting (const QString &key, const QString& defaultValue); diff --git a/src/api/QGCCorePlugin.cc b/src/api/QGCCorePlugin.cc index d0685823a5c713ac0e2b635f7bf8cd000f3d4acc..1f9bf4e92f6a34c22b257d17ce197c17afb6a50b 100644 --- a/src/api/QGCCorePlugin.cc +++ b/src/api/QGCCorePlugin.cc @@ -79,8 +79,8 @@ QGCCorePlugin::~QGCCorePlugin() } } -QGCCorePlugin::QGCCorePlugin(QGCApplication *app) - : QGCTool(app) +QGCCorePlugin::QGCCorePlugin(QGCApplication *app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _showTouchAreas(false) , _showAdvancedUI(true) { diff --git a/src/api/QGCCorePlugin.h b/src/api/QGCCorePlugin.h index 324d7174e2e2a72592d649f49afa996908b760f1..acb5b4f528964a61f4f20d90c4f565cb7596fcf3 100644 --- a/src/api/QGCCorePlugin.h +++ b/src/api/QGCCorePlugin.h @@ -31,7 +31,7 @@ class QGCCorePlugin : public QGCTool { Q_OBJECT public: - QGCCorePlugin(QGCApplication* app); + QGCCorePlugin(QGCApplication* app, QGCToolbox* toolbox); ~QGCCorePlugin(); Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged) diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 29a9848118981aa0cca501eff9ac22c6f297a0ec..ff5350a53dfcd5c95cd029532d82e7865912d710 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -42,8 +42,8 @@ const int LinkManager::_autoconnectConnectDelayMSecs = 6000; const int LinkManager::_autoconnectConnectDelayMSecs = 1000; #endif -LinkManager::LinkManager(QGCApplication* app) - : QGCTool(app) +LinkManager::LinkManager(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _configUpdateSuspended(false) , _configurationsLoaded(false) , _connectionsSuspended(false) diff --git a/src/comm/LinkManager.h b/src/comm/LinkManager.h index 9341b5625a9a768b091533bde82e2279e17afda9..7a44cb0eb1602e33b9026a27b845d13f9fc3d12e 100644 --- a/src/comm/LinkManager.h +++ b/src/comm/LinkManager.h @@ -58,7 +58,7 @@ class LinkManager : public QGCTool friend class LinkManagerTest; public: - LinkManager(QGCApplication* app); + LinkManager(QGCApplication* app, QGCToolbox* toolbox); ~LinkManager(); Q_PROPERTY(bool isBluetoothAvailable READ isBluetoothAvailable CONSTANT) diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 5067c5e1e6a2088ebb22fc07f5532f6aea71034c..3f195cd1b5d7b4bf95019147e51a01c169d803c2 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -50,8 +50,8 @@ const char* MAVLinkProtocol::_logFileExtension = "mavlink"; ///< Ext * The default constructor will create a new MAVLink object sending heartbeats at * the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links. */ -MAVLinkProtocol::MAVLinkProtocol(QGCApplication* app) - : QGCTool(app) +MAVLinkProtocol::MAVLinkProtocol(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , m_enable_version_check(true) , versionMismatchIgnore(false) , systemId(255) diff --git a/src/comm/MAVLinkProtocol.h b/src/comm/MAVLinkProtocol.h index 7890061b6fbfd38a666f7220db55668419d9e53d..03026529d3d779ec303d14f600b0b35f669326d6 100644 --- a/src/comm/MAVLinkProtocol.h +++ b/src/comm/MAVLinkProtocol.h @@ -43,7 +43,7 @@ class MAVLinkProtocol : public QGCTool Q_OBJECT public: - MAVLinkProtocol(QGCApplication* app); + MAVLinkProtocol(QGCApplication* app, QGCToolbox* toolbox); ~MAVLinkProtocol(); /** @brief Get the human-friendly name of this protocol */ diff --git a/src/uas/UASMessageHandler.cc b/src/uas/UASMessageHandler.cc index 51941c9a65ad77d077a3811e0d58a9abc54546de..34f3c41b65af53e1f9c2a3eb03d5b00854267657 100644 --- a/src/uas/UASMessageHandler.cc +++ b/src/uas/UASMessageHandler.cc @@ -39,8 +39,8 @@ bool UASMessage::severityIsError() } } -UASMessageHandler::UASMessageHandler(QGCApplication* app) - : QGCTool(app) +UASMessageHandler::UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox) + : QGCTool(app, toolbox) , _activeVehicle(NULL) , _activeComponent(-1) , _multiComp(false) diff --git a/src/uas/UASMessageHandler.h b/src/uas/UASMessageHandler.h index 3b039e22e30730c2cac042e28cc62f136ee29eb7..854a60bc2f785fc75a73466643e82c6fb29a0eb1 100644 --- a/src/uas/UASMessageHandler.h +++ b/src/uas/UASMessageHandler.h @@ -72,7 +72,7 @@ class UASMessageHandler : public QGCTool Q_OBJECT public: - explicit UASMessageHandler(QGCApplication* app); + explicit UASMessageHandler(QGCApplication* app, QGCToolbox* toolbox); ~UASMessageHandler(); /**