refs #246 refactored construction of the network context into a factory method

This commit is contained in:
Mathew Sutcliffe
2014-06-11 22:36:53 +01:00
parent 695eb5c41c
commit cdca7343e4
5 changed files with 33 additions and 13 deletions

View File

@@ -394,18 +394,7 @@ namespace BlackCore
}
times.insert("Audio", time.restart());
switch (config.getModeNetwork())
{
case CRuntimeConfig::Local:
case CRuntimeConfig::LocalInDbusServer:
this->m_contextNetwork = (new CContextNetwork(config.getModeNetwork(), this))->registerWithDBus(this->m_dbusServer);
break;
case CRuntimeConfig::Remote:
this->m_contextNetwork = new BlackCore::CContextNetworkProxy(BlackCore::CDBusServer::ServiceName, this->m_dbusConnection, config.getModeNetwork(), this);
break;
default:
break; // network not mandatory
}
this->m_contextNetwork = IContextNetwork::create(this, config.getModeNetwork(), this->m_dbusServer, this->m_dbusConnection);
times.insert("Network", time.restart());
switch (config.getModeSimulator())