From d7a63c15d4f4e836c20ba1c361e958814d4c6158 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Wed, 27 Apr 2016 18:30:28 +0100 Subject: [PATCH] refs #644 Move initial settings load to CApplication::start. --- src/blackcore/application.cpp | 21 ++++++++++++--------- src/blackcore/corefacade.cpp | 5 ----- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index fb5870b2a..c5c26bbc1 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -81,15 +81,6 @@ namespace BlackCore this->m_cookieManager.setParent(&this->m_accessManager); this->m_accessManager.setCookieJar(&this->m_cookieManager); - // trigger loading of settings - //! \todo maybe loaded twice, context initializing might trigger loading of settings a second time - CStatusMessage m = CSettingsCache::instance()->loadFromStore(); - if (!m.isEmpty()) - { - m.setCategories(getLogCategories()); - CLogMessage::preformatted(m); - } - // global setup sApp = this; this->m_setupReader.reset(new CSetupReader(this)); @@ -158,6 +149,18 @@ namespace BlackCore } bool s = this->startHookIn(); + + // trigger loading of settings in appropriate scenarios + if (this->m_coreFacadeConfig.getModeApplication() != CCoreFacadeConfig::Remote) + { + CStatusMessage m = CSettingsCache::instance()->loadFromStore(); + if (!m.isEmpty()) + { + m.setCategories(getLogCategories()); + CLogMessage::preformatted(m); + } + } + if (waitForStart) { s = this->waitForStart(); diff --git a/src/blackcore/corefacade.cpp b/src/blackcore/corefacade.cpp index 89c4553a9..a3e6ef0d2 100644 --- a/src/blackcore/corefacade.cpp +++ b/src/blackcore/corefacade.cpp @@ -178,11 +178,6 @@ namespace BlackCore Q_ASSERT(c); } - // settings - if (this->getIContextApplication()) { - this->getIContextApplication()->loadSettings(); - } - // times times.insert("Post setup, sim.connects", time.restart()); }