From 400415f5a9786c35340906b0e815447870df3bb4 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Tue, 27 Jun 2023 19:58:17 +0200 Subject: [PATCH] Don't show splash screen at all when launching a second instance manually --- src/app/app.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index cd35647abdeff..22250697be8a1 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -166,21 +166,19 @@ int App::run(int argc, char** argv) #ifdef MUE_BUILD_APPSHELL_MODULE SplashScreen* splashScreen = nullptr; if (runMode == framework::IApplication::RunMode::GuiApp) { - SplashScreen::SplashScreenType type = SplashScreen::Default; - QString fileName; - - if (!multiInstancesProvider()->isMainInstance()) { + if (multiInstancesProvider()->isMainInstance()) { + splashScreen = new SplashScreen(SplashScreen::Default); + } else { project::ProjectFile file = startupScenario()->startupScoreFile(); - if (file.isValid()) { - type = SplashScreen::ForNewInstance; - fileName = file.displayName(true /* includingExtension */); + splashScreen = new SplashScreen(SplashScreen::ForNewInstance, file.displayName(true /* includingExtension */)); } else if (startupScenario()->isStartWithNewFileAsSecondaryInstance()) { - type = SplashScreen::ForNewInstance; + splashScreen = new SplashScreen(SplashScreen::ForNewInstance); } } + } - splashScreen = new SplashScreen(type, fileName); + if (splashScreen) { splashScreen->show(); } #endif