diff --git a/companion/src/companion.cpp b/companion/src/companion.cpp index 62c8b480c..7f93f1645 100644 --- a/companion/src/companion.cpp +++ b/companion/src/companion.cpp @@ -240,27 +240,24 @@ int main(int argc, char *argv[]) profile.fwName(""); } - QString splashScreen; - splashScreen = ":/images/splash.png"; - - QPixmap pixmap = QPixmap(splashScreen); - QSplashScreen *splash = new QSplashScreen(pixmap); - Firmware::setCurrentVariant(Firmware::getFirmwareForId(g.profile[g.id()].fwType())); MainWindow *mainWin = new MainWindow(); + mainWin->show(); + if (g.showSplash()) { - splash->show(); - QTimer::singleShot(1000*SPLASH_TIME, splash, SLOT(close())); - QTimer::singleShot(1000*SPLASH_TIME, mainWin, SLOT(show())); - } - else { - mainWin->show(); + QSplashScreen *splash = new QSplashScreen(QPixmap(":/images/splash.png")); + QTimer::singleShot(1, [=] { + splash->show(); + }); + QTimer::singleShot(1000*SPLASH_TIME, [=] { + splash->close(); + delete splash; + }); } int result = app.exec(); - delete splash; delete mainWin; SimulatorLoader::unregisterSimulators();