Tidying config init methods

This commit is contained in:
Nav
2021-10-26 22:28:57 +01:00
parent e2c4dcb97f
commit db74d8f3fd
2 changed files with 10 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
using namespace Bloom;
void ApplicationConfig::init(QJsonObject jsonObject) {
void ApplicationConfig::init(const QJsonObject& jsonObject) {
if (!jsonObject.contains("environments")) {
throw Exceptions::InvalidConfig("No environments found.");
}
@@ -43,7 +43,7 @@ void ApplicationConfig::init(QJsonObject jsonObject) {
}
}
void InsightConfig::init(QJsonObject jsonObject) {
void InsightConfig::init(const QJsonObject& jsonObject) {
if (jsonObject.contains("enabled")) {
this->insightEnabled = jsonObject.find("enabled").value().toBool();
}
@@ -75,7 +75,7 @@ void EnvironmentConfig::init(std::string name, QJsonObject jsonObject) {
}
}
void TargetConfig::init(QJsonObject jsonObject) {
void TargetConfig::init(const QJsonObject& jsonObject) {
if (!jsonObject.contains("name")) {
throw Exceptions::InvalidConfig("No target name found.");
}
@@ -89,7 +89,7 @@ void TargetConfig::init(QJsonObject jsonObject) {
this->jsonObject = jsonObject;
}
void DebugToolConfig::init(QJsonObject jsonObject) {
void DebugToolConfig::init(const QJsonObject& jsonObject) {
if (!jsonObject.contains("name")) {
throw Exceptions::InvalidConfig("No debug tool name found.");
}
@@ -103,7 +103,7 @@ void DebugToolConfig::init(QJsonObject jsonObject) {
this->jsonObject = jsonObject;
}
void DebugServerConfig::init(QJsonObject jsonObject) {
void DebugServerConfig::init(const QJsonObject& jsonObject) {
this->name = jsonObject.find("name")->toString().toLower().toStdString();
this->jsonObject = jsonObject;
}

View File

@@ -47,7 +47,7 @@ namespace Bloom
*
* @param jsonObject
*/
void init(QJsonObject jsonObject);
void init(const QJsonObject& jsonObject);
/**
* The name of the selected target.
@@ -78,7 +78,7 @@ namespace Bloom
*
* @param jsonObject
*/
void init(QJsonObject jsonObject);
void init(const QJsonObject& jsonObject);
/**
* The name of the selected debug tool.
@@ -107,7 +107,7 @@ namespace Bloom
*
* @param jsonObject
*/
void init(QJsonObject jsonObject);
void init(const QJsonObject& jsonObject);
std::string name;
QJsonObject jsonObject;
@@ -120,7 +120,7 @@ namespace Bloom
*
* @param jsonObject
*/
void init(QJsonObject jsonObject);
void init(const QJsonObject& jsonObject);
bool insightEnabled = true;
};
@@ -183,7 +183,7 @@ namespace Bloom
*
* @param jsonObject
*/
void init(QJsonObject jsonObject);
void init(const QJsonObject& jsonObject);
/**
* A mapping of environment names to EnvironmentConfig objects.