Defined paths in Paths helper class

This commit is contained in:
Nav
2022-01-02 20:25:25 +00:00
parent addb3ef64e
commit 0faa97fc68
2 changed files with 22 additions and 5 deletions

View File

@@ -154,17 +154,16 @@ void Application::shutdown() {
}
void Application::loadProjectConfiguration() {
auto currentPath = std::filesystem::current_path().string();
auto jsonConfigFile = QFile(QString::fromStdString(currentPath + "/bloom.json"));
auto jsonConfigFile = QFile(QString::fromStdString(Paths::projectConfigPath()));
if (!jsonConfigFile.exists()) {
throw InvalidConfig("Bloom configuration file (bloom.json) not found. Working directory: "
+ currentPath);
+ Paths::projectDirPath());
}
if (!jsonConfigFile.open(QIODevice::ReadOnly)) {
throw InvalidConfig("Failed to load Bloom configuration file (bloom.json) Working directory: "
+ currentPath);
+ Paths::projectDirPath());
}
auto jsonObject = QJsonDocument::fromJson(jsonConfigFile.readAll()).object();