Correcting IDE refactor issues

This commit is contained in:
Nav
2022-02-06 13:45:35 +00:00
parent 53a3c815d7
commit bc585f4396

View File

@@ -9,7 +9,7 @@
#include "src/Logger/Logger.hpp" #include "src/Logger/Logger.hpp"
#include "src/Helpers/Paths.hpp" #include "src/Helpers/Paths.hpp"
#include "Exceptions/InvalidConfig.hpp" #include "src/Exceptions/InvalidConfig.hpp"
namespace Bloom namespace Bloom
{ {
@@ -70,12 +70,10 @@ namespace Bloom
this->applicationEventListener->waitAndDispatch(); this->applicationEventListener->waitAndDispatch();
} }
} } catch (const InvalidConfig& exception) {
catch (const InvalidConfig& exception) {
Logger::error(exception.getMessage()); Logger::error(exception.getMessage());
} } catch (const Exception& exception) {
catch (const Exception& exception) {
Logger::error(exception.getMessage()); Logger::error(exception.getMessage());
} }
@@ -154,8 +152,7 @@ namespace Bloom
this->projectSettings = ProjectSettings(jsonObject); this->projectSettings = ProjectSettings(jsonObject);
return; return;
} } catch (const std::exception& exception) {
catch (const std::exception& exception) {
Logger::error( Logger::error(
"Failed to load project settings from " + projectSettingsPath + " - " + exception.what() "Failed to load project settings from " + projectSettingsPath + " - " + exception.what()
); );
@@ -189,8 +186,7 @@ namespace Bloom
jsonSettingsFile.write(jsonDocument.toJson()); jsonSettingsFile.write(jsonDocument.toJson());
jsonSettingsFile.close(); jsonSettingsFile.close();
} } catch (const Exception& exception) {
catch (const Exception& exception) {
Logger::error( Logger::error(
"Failed to save project settings - " + exception.getMessage() "Failed to save project settings - " + exception.getMessage()
); );
@@ -227,24 +223,20 @@ namespace Bloom
if (this->environmentConfig->insightConfig.has_value()) { if (this->environmentConfig->insightConfig.has_value()) {
this->insightConfig = this->environmentConfig->insightConfig.value(); this->insightConfig = this->environmentConfig->insightConfig.value();
} } else if (this->projectConfig->insightConfig.has_value()) {
else if (this->projectConfig->insightConfig.has_value()) {
this->insightConfig = this->projectConfig->insightConfig.value(); this->insightConfig = this->projectConfig->insightConfig.value();
} } else {
else {
throw InvalidConfig("Insight configuration missing."); throw InvalidConfig("Insight configuration missing.");
} }
if (this->environmentConfig->debugServerConfig.has_value()) { if (this->environmentConfig->debugServerConfig.has_value()) {
this->debugServerConfig = this->environmentConfig->debugServerConfig.value(); this->debugServerConfig = this->environmentConfig->debugServerConfig.value();
} } else if (this->projectConfig->debugServerConfig.has_value()) {
else if (this->projectConfig->debugServerConfig.has_value()) {
this->debugServerConfig = this->projectConfig->debugServerConfig.value(); this->debugServerConfig = this->projectConfig->debugServerConfig.value();
} } else {
else {
throw InvalidConfig("Debug server configuration missing."); throw InvalidConfig("Debug server configuration missing.");
} }
} }
@@ -257,11 +249,7 @@ namespace Bloom
Logger::silence(); Logger::silence();
// The file help.txt is included in the binary image as a resource. See src/resource.qrc // The file help.txt is included in the binary image as a resource. See src/resource.qrc
auto helpFile = QFile(QString::fromStdString( auto helpFile = QFile(QString::fromStdString(Paths::compiledResourcesPath() + "/resources/help.txt"));
Paths::compiledResourcesPath()
+ "/resources/help.txt"
)
);
if (!helpFile.open(QIODevice::ReadOnly)) { if (!helpFile.open(QIODevice::ReadOnly)) {
// This should never happen - if it does, something has gone very wrong // This should never happen - if it does, something has gone very wrong