diff --git a/src/lib/ProjectSettings.cpp b/src/lib/ProjectSettings.cpp index f0273377..2a8fd0e2 100644 --- a/src/lib/ProjectSettings.cpp +++ b/src/lib/ProjectSettings.cpp @@ -1,10 +1,8 @@ #include "ProjectSettings.h" -#include "utility/logging/logging.h" - -#include "utility/text/TextAccess.h" - #include "utility/FileSystem.h" +#include "utility/logging/logging.h" +#include "utility/text/TextAccess.h" std::shared_ptr ProjectSettings::s_instance; @@ -20,7 +18,7 @@ std::shared_ptr ProjectSettings::getInstance() ProjectSettings::ProjectSettings() { -} +} ProjectSettings::~ProjectSettings() { @@ -32,6 +30,7 @@ bool ProjectSettings::load(const std::string& projectSettingsFilePath) if (FileSystem::exists(projectSettingsFilePath)) { m_config = ConfigManager::createAndLoad(TextAccess::createFromFile(projectSettingsFilePath)); + return true; } else { @@ -42,7 +41,7 @@ bool ProjectSettings::load(const std::string& projectSettingsFilePath) void ProjectSettings::save(const std::string& projectSettingsFilePath) { - if(m_config) + if (m_config) { m_config->save(); } @@ -50,10 +49,10 @@ void ProjectSettings::save(const std::string& projectSettingsFilePath) std::string ProjectSettings::getSourcePath() const { - if(m_config) + if (m_config) { std::string sourcePath; - if(m_config->getValue("SourcePath", sourcePath)) + if (m_config->getValue("SourcePath", sourcePath)) { return sourcePath; } @@ -63,9 +62,8 @@ std::string ProjectSettings::getSourcePath() const void ProjectSettings::setSourcePath(const std::string& sourcePath) { - if(m_config) + if (m_config) { m_config->setValue("SourcePath", sourcePath); } - } diff --git a/src/lib/ProjectSettings.h b/src/lib/ProjectSettings.h index a1b9ad73..2106d3fb 100644 --- a/src/lib/ProjectSettings.h +++ b/src/lib/ProjectSettings.h @@ -15,8 +15,7 @@ public: bool load(const std::string& projectSettingsFilePath); void save(const std::string& projectSettingsFilePath); -std::string getSourcePath() const; - + std::string getSourcePath() const; void setSourcePath(const std::string& sourcePath); private: