Skip to content

Commit

Permalink
Resolving #31
Browse files Browse the repository at this point in the history
Bug in checking for config files.
  • Loading branch information
wolf-sigma committed Jul 14, 2016
1 parent 76c1538 commit 54a3c3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions es-app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ int main(int argc, char* argv[])
Settings::getInstance()->setString("ConfigDirectory", getDefaultConfigDirectory());
}
}
if(!Settings::getInstance()->loadFile()){
std::cerr << "Couldn't load settings from \"" << getConfigDirectory();
return 1;

bool loaded_file = Settings::getInstance()->loadFile();
if(!loaded_file){
std::cout << "Couldn't load settings from \"" << getConfigDirectory() << ". Will create new ones." << "\n";
}

Log::open();
Expand Down Expand Up @@ -270,7 +271,7 @@ int main(int argc, char* argv[])
// something went terribly wrong
if(errorMsg == NULL)
{
LOG(LogError) << "Unknown error occured while parsing system config file.";
LOG(LogError) << "Unknown error occurred while parsing system config file.";
if(!scrape_cmdline)
Renderer::deinit();
return 1;
Expand Down
2 changes: 2 additions & 0 deletions es-core/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ bool Settings::loadFile()
const std::string path = getConfigDirectory() + "/es_settings.cfg";

if(!boost::filesystem::exists(path))
{
return false;
}

pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file(path.c_str());
Expand Down

0 comments on commit 54a3c3e

Please sign in to comment.