diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp index e9c1acd8..4b291e75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -596,13 +596,17 @@ int runApplication(MOApplication &application, SingleInstance &instance, checkPathsForSanity(*game, settings); - if (splashPath.startsWith(':')) { - // currently using MO splash, see if the plugin contains one - QString pluginSplash + bool useSplash = settings.useSplash(); + + if (useSplash) { + if (splashPath.startsWith(':')) { + // currently using MO splash, see if the plugin contains one + QString pluginSplash = QString(":/%1/splash").arg(game->gameShortName()); - QImage image(pluginSplash); - if (!image.isNull()) { - image.save(dataPath + "/splash.png"); + QImage image(pluginSplash); + if (!image.isNull()) { + image.save(dataPath + "/splash.png"); + } } } @@ -697,12 +701,18 @@ int runApplication(MOApplication &application, SingleInstance &instance, } } - QPixmap pixmap(splashPath); - QSplashScreen splash(pixmap); + QPixmap pixmap; + + QSplashScreen splash(nullptr); + + if (useSplash) { + pixmap = QPixmap(splashPath); + splash.setPixmap(pixmap); - settings.geometry().centerOnMainWindowMonitor(&splash); - splash.show(); - splash.activateWindow(); + settings.geometry().centerOnMainWindowMonitor(&splash); + splash.show(); + splash.activateWindow(); + } QString apiKey; if (settings.nexus().apiKey(apiKey)) { @@ -737,10 +747,12 @@ int runApplication(MOApplication &application, SingleInstance &instance, log::debug("displaying main window"); mainWindow.show(); mainWindow.activateWindow(); - - // don't pass mainwindow as it just waits half a second for it - // instead of proceding - splash.finish(nullptr); + + if (useSplash) { + // don't pass mainwindow as it just waits half a second for it + // instead of proceding + splash.finish(nullptr); + } res = application.exec(); mainWindow.close(); |
