Browse Source

Change toolbox startup mechanism

This prevents problems with toolbox references from inside
QGCTool::setToolbox calls.
QGC4.4
Don Gagne 9 years ago
parent
commit
61202e9a3d
  1. 1
      src/QGCApplication.cc
  2. 3
      src/QGCToolbox.cc
  3. 4
      src/QGCToolbox.h

1
src/QGCApplication.cc

@ -343,6 +343,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
initializeVideoStreaming(argc, argv); initializeVideoStreaming(argc, argv);
_toolbox = new QGCToolbox(this); _toolbox = new QGCToolbox(this);
_toolbox->setChildToolboxes();
} }
QGCApplication::~QGCApplication() QGCApplication::~QGCApplication()

3
src/QGCToolbox.cc

@ -71,7 +71,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_qgcPositionManager = new QGCPositionManager(app); _qgcPositionManager = new QGCPositionManager(app);
_followMe = new FollowMe(app); _followMe = new FollowMe(app);
_videoManager = new VideoManager(app); _videoManager = new VideoManager(app);
}
void QGCToolbox::setChildToolboxes(void)
{
_audioOutput->setToolbox(this); _audioOutput->setToolbox(this);
_autopilotPluginManager->setToolbox(this); _autopilotPluginManager->setToolbox(this);
_factSystem->setToolbox(this); _factSystem->setToolbox(this);

4
src/QGCToolbox.h

@ -61,6 +61,8 @@ public:
#endif #endif
private: private:
void setChildToolboxes(void);
GAudioOutput* _audioOutput; GAudioOutput* _audioOutput;
AutoPilotPluginManager* _autopilotPluginManager; AutoPilotPluginManager* _autopilotPluginManager;
FactSystem* _factSystem; FactSystem* _factSystem;
@ -81,6 +83,8 @@ private:
FollowMe* _followMe; FollowMe* _followMe;
QGCPositionManager* _qgcPositionManager; QGCPositionManager* _qgcPositionManager;
VideoManager* _videoManager; VideoManager* _videoManager;
friend class QGCApplication;
}; };
/// This is the base class for all tools /// This is the base class for all tools

Loading…
Cancel
Save