changeset 2518:f3f9114ff295

Improve chances of user getting to see splash screen (rather than empty box) by processing events a little more
author Chris Cannam
date Wed, 29 Apr 2020 13:27:59 +0100
parents 27dc177e114f
children e9506f77388d
files main/main.cpp
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main/main.cpp	Wed Apr 29 13:27:22 2020 +0100
+++ b/main/main.cpp	Wed Apr 29 13:27:59 2020 +0100
@@ -356,13 +356,19 @@
     settings.endGroup();
 
     settings.beginGroup("Preferences");
-    if (showSplash && settings.value("show-splash", true).toBool()) {
+    if (showSplash) {
+        if (!settings.value("show-splash", true).toBool()) {
+            showSplash = false;
+        }
+    }
+    settings.endGroup();
+
+    if (showSplash) {
         splash = new SVSplash();
         splash->show();
         QTimer::singleShot(5000, splash, SLOT(hide()));
         application.processEvents();
     }
-    settings.endGroup();
 
     settings.beginGroup("RDF");
     QStringList list;
@@ -394,6 +400,10 @@
     }
     QApplication::setWindowIcon(icon);
 
+    if (showSplash) {
+        application.processEvents();
+    }
+
     QTranslator qtTranslator;
     QString qtTrName = QString("qt_%1").arg(language);
     SVDEBUG << "Loading " << qtTrName << "... ";
@@ -428,6 +438,10 @@
     // Make known-plugins query as early as possible after showing
     // splash screen.
     PluginScan::getInstance()->scan();
+
+    if (showSplash) {
+        application.processEvents();
+    }
     
     // Permit these types to be used as args in queued signal calls
     qRegisterMetaType<PropertyContainer::PropertyName>("PropertyContainer::PropertyName");