From 14e9e01b909490ea6f796e32b16b85ccdc58827c Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Sun, 15 Jun 2014 19:02:46 +0200 Subject: [PATCH] Fix reading settings with factory created object. Before we had factory methods, the allocated CContextSettings object was reused. The temporary one can be deleted. --- src/blackcore/context_runtime.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blackcore/context_runtime.cpp b/src/blackcore/context_runtime.cpp index cc71e3d92..64c9c9044 100644 --- a/src/blackcore/context_runtime.cpp +++ b/src/blackcore/context_runtime.cpp @@ -312,12 +312,16 @@ namespace BlackCore QTime time; time.start(); + // FIXME RW: We are allocating a full settings context in order to get the DBus address. + // I wonder if this can be done cleaner. if (config.hasDBusAddress()) dbusAddress = config.getDBusAddress(); // bootstrap / explicit if (config.hasLocalSettings()) { settings = new CContextSettings(config.getModeSettings(), this); if (settings) settings->read(); if (dbusAddress.isEmpty()) dbusAddress = settings->getNetworkSettings().getDBusServerAddress(); + + settings->deleteLater(); } // DBus @@ -338,6 +342,7 @@ 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);