Commit 4ea83c50 authored by Don Gagne's avatar Don Gagne

Cleanup for use with unit test

Splash screen is optional. Also remove some unused class definition.
parent 6c35a7ff
......@@ -88,7 +88,6 @@ const QString MainWindow::defaultLightStyle = ":files/styles/style-light.css";
MainWindow* MainWindow::_create(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE mode)
{
Q_ASSERT(_instance == NULL);
Q_ASSERT(splashScreen);
new MainWindow(splashScreen, mode);
......@@ -125,12 +124,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE
menuActionHelper(new MenuActionHelper()),
_splashScreen(splashScreen)
{
Q_ASSERT(splashScreen);
Q_ASSERT(_instance == NULL);
_instance = this;
connect(this, &MainWindow::initStatusChanged, splashScreen, &QSplashScreen::showMessage);
if (splashScreen) {
connect(this, &MainWindow::initStatusChanged, splashScreen, &QSplashScreen::showMessage);
}
this->setAttribute(Qt::WA_DeleteOnClose);
connect(menuActionHelper, SIGNAL(needToShowDockWidget(QString,bool)),SLOT(showDockWidget(QString,bool)));
......
......@@ -468,14 +468,9 @@ private slots:
void _saveTempFlightDataLog(QString tempLogfile);
private:
/// Constructor is private since all creation should be through MainWindow::instance.
/// Constructor is private since all creation should be through MainWindow::_create
MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE mode);
/// @brief Two phase construction such that MainWindow::instance is available to code
void _init(void);
friend class QGCApplication;
void _hideSplashScreen(void);
void _openUrl(const QString& url, const QString& errorMessage);
......
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