From 2e485a324c6b6ed832e5fac7a1bb29fed495b94e Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Sun, 15 Jun 2014 20:24:40 +0200 Subject: [PATCH] Move settings loading into factory method, since read should not be called by DBus proxy. --- src/blackcore/context_runtime.cpp | 1 - src/blackcore/context_settings.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/blackcore/context_runtime.cpp b/src/blackcore/context_runtime.cpp index 64c9c9044..66f682861 100644 --- a/src/blackcore/context_runtime.cpp +++ b/src/blackcore/context_runtime.cpp @@ -342,7 +342,6 @@ namespace BlackCore // contexts this->m_contextSettings = IContextSettings::create(this, config.getModeSettings(), this->m_dbusServer, this->m_dbusConnection); - this->m_contextSettings->read(); times.insert("Settings", time.restart()); this->m_contextApplication = IContextApplication::create(this, config.getModeApplication(), this->m_dbusServer, this->m_dbusConnection); diff --git a/src/blackcore/context_settings.cpp b/src/blackcore/context_settings.cpp index d468b840a..6b4f8a7f2 100644 --- a/src/blackcore/context_settings.cpp +++ b/src/blackcore/context_settings.cpp @@ -16,7 +16,12 @@ namespace BlackCore { case CRuntimeConfig::Local: case CRuntimeConfig::LocalInDbusServer: - return (new CContextSettings(mode, parent))->registerWithDBus(server); + { + CContextSettings *contextSettings = new CContextSettings(mode, parent); + contextSettings->registerWithDBus(server); + contextSettings->read(); + return contextSettings; + } case CRuntimeConfig::Remote: return new BlackCore::CContextSettingsProxy(BlackCore::CDBusServer::ServiceName, conn, mode, parent); default: