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

3
src/QGCToolbox.cc

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

4
src/QGCToolbox.h

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

Loading…
Cancel
Save