Improved handling of late initialisation for component objects

This commit is contained in:
Nav
2021-12-31 19:45:15 +00:00
parent d24587b992
commit 49383eb448
9 changed files with 109 additions and 72 deletions

View File

@@ -37,8 +37,16 @@ namespace Bloom
*
* @param eventManager
*/
explicit Insight(EventManager& eventManager):
explicit Insight(
EventManager& eventManager,
const ProjectConfig& projectConfig,
const EnvironmentConfig& environmentConfig,
const InsightConfig& insightConfig
):
eventManager(eventManager),
projectConfig(projectConfig),
environmentConfig(environmentConfig),
insightConfig(insightConfig),
application(
(
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, false),
@@ -49,18 +57,6 @@ namespace Bloom
)
) {};
void setProjectConfig(const ProjectConfig& projectConfig) {
this->projectConfig = projectConfig;
}
void setEnvironmentConfig(const EnvironmentConfig& environmentConfig) {
this->environmentConfig = environmentConfig;
}
void setInsightConfig(const InsightConfig& insightConfig) {
this->insightConfig = insightConfig;
}
/**
* Entry point for Insight.
*/
@@ -80,7 +76,11 @@ namespace Bloom
QApplication application;
InsightWorker* insightWorker = new InsightWorker(this->eventManager);
InsightWindow* mainWindow = new InsightWindow(*(this->insightWorker));
InsightWindow* mainWindow = new InsightWindow(
*(this->insightWorker),
this->environmentConfig,
this->insightConfig
);
TargetControllerConsole targetControllerConsole = TargetControllerConsole(
this->eventManager,