diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 5ca2afe68..4494c03aa 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -200,6 +200,7 @@ namespace BlackCore int CApplication::exec() { Q_ASSERT_X(instance(), Q_FUNC_INFO, "missing application"); + emit this->startUpCompleted(true); CApplication::registerAsRunning(); return QCoreApplication::exec(); } @@ -1074,8 +1075,6 @@ namespace BlackCore const CStatusMessageList msgs = this->asyncWebAndContextStart(); m_started = msgs.isSuccess(); } - - if (m_signalStartup) { emit this->startUpCompleted(m_started); } } void CApplication::onStartUpCompleted() diff --git a/src/blackcore/application.h b/src/blackcore/application.h index 37d51999b..3091e8e42 100644 --- a/src/blackcore/application.h +++ b/src/blackcore/application.h @@ -190,15 +190,15 @@ namespace BlackCore //! Running with dev.flag? bool isDeveloperFlagSet() const { return m_devFlag; } - //! Signal startup automatically or individually - void setSignalStartupAutomatically(bool enabled) { m_signalStartup = enabled; } - //! Comprehensive info QString getInfoString(const QString &separator) const; //! Stop and restart application void restartApplication(const QStringList &newArguments = {}, const QStringList &removeArguments = {}); + //! Finishes initialization and executes the event loop + int exec(); + //! Directory for temporary files static QString getTemporaryDirectory(); @@ -210,9 +210,6 @@ namespace BlackCore //! \note Normally done automatically, needed for restart static bool unregisterAsRunning(); - //! Run event loop - static int exec(); - //! Exit application, perform graceful shutdown and exit static void exit(int retcode = EXIT_SUCCESS); @@ -563,8 +560,7 @@ namespace BlackCore void updateInfoAvailable(bool success); //! Startup has been completed - //! \remark needs to be triggered by application when it think it is done - //! \fixme http://doc.qt.io/qt-5/signalsandslots.html#signals recommends signals be only emitted by their own class + //! Will be triggered shortly before starting the event loop void startUpCompleted(bool success); //! Facade started @@ -735,7 +731,6 @@ namespace BlackCore bool m_noNwAccessPoint = false; //!< no network access point? bool m_useContexts = false; //!< use contexts bool m_useWebData = false; //!< use web data - bool m_signalStartup = true; //!< signal startup automatically bool m_devFlag = false; //!< dev. environment bool m_saveSettingsOnShutdown = true; //!< saving all settings on shutdown bool m_localSettingsLoaded = false; //!< local settings loaded? diff --git a/src/swiftdata/main.cpp b/src/swiftdata/main.cpp index c0a36d91e..aa7dfa9d4 100644 --- a/src/swiftdata/main.cpp +++ b/src/swiftdata/main.cpp @@ -25,7 +25,6 @@ int main(int argc, char *argv[]) CCrashHandler::instance()->init(); CGuiApplication a(CApplicationInfo::swiftMappingTool(), CApplicationInfo::MappingTool, CIcons::swiftDatabase48()); - a.setSignalStartupAutomatically(false); // application will signal startup on its own a.splashScreen(CIcons::swiftDatabase256()); if (!a.parseAndLoadSetup()) { return EXIT_FAILURE; } a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forMappingTool()); diff --git a/src/swiftdata/swiftdata.cpp b/src/swiftdata/swiftdata.cpp index 94388227c..a7e86dc65 100644 --- a/src/swiftdata/swiftdata.cpp +++ b/src/swiftdata/swiftdata.cpp @@ -106,8 +106,6 @@ void CSwiftData::init() this->checkMinimumVersion(); this->checkAutoPublishing(); }); - - emit sGui->startUpCompleted(true); } void CSwiftData::initLogDisplay() diff --git a/src/swiftguistandard/main.cpp b/src/swiftguistandard/main.cpp index 0c1ec8714..e204a19db 100644 --- a/src/swiftguistandard/main.cpp +++ b/src/swiftguistandard/main.cpp @@ -37,7 +37,6 @@ int main(int argc, char *argv[]) int r = 0; { CSwiftGuiStdApplication a; // application with contexts - a.setSignalStartupAutomatically(false); // application will signal startup on its own a.splashScreen(CIcons::swift256()); a.setMinimumSizeInCharacters(60, 42); // experimental if (!a.parseAndLoadSetup()) { return EXIT_FAILURE; } diff --git a/src/swiftguistandard/swiftguistdinit.cpp b/src/swiftguistandard/swiftguistdinit.cpp index 2e8c113ca..526b6ae24 100644 --- a/src/swiftguistandard/swiftguistdinit.cpp +++ b/src/swiftguistandard/swiftguistdinit.cpp @@ -196,7 +196,6 @@ void SwiftGuiStd::init() sGui->triggerNewVersionCheck(10 * 1000); // done - emit sGui->startUpCompleted(true); m_init = true; } diff --git a/src/swiftlauncher/main.cpp b/src/swiftlauncher/main.cpp index 7738bb16a..1263b73b2 100644 --- a/src/swiftlauncher/main.cpp +++ b/src/swiftlauncher/main.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) //! [SwiftApplicationDemo] CSwiftLauncher launcher; - const int res = CGuiApplication::exec(); + const int res = a.exec(); if (res != EXIT_SUCCESS || !launcher.shouldStartAppDetached()) { return res;