diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 312a873a68cfdee6adbdf80c8eccd2119079a832..38b56ab20dbe5e9c218d2c8b2658c90de004c550 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -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))); diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index fa81c9b09c8a7e3ab54d880ece0e0a173a0e292b..07f85bc3a0bc52295a6bea8c1cdbb43bfe7f0c10 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -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);