From 2510fb1e916b3973605118cf27c8519c3431163d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Mon, 26 Oct 2015 20:40:20 +0100 Subject: [PATCH] Using wrong keyword, one hour of my life I never get back --- src/config.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.cc b/src/config.cc index 20d4e08..3926604 100644 --- a/src/config.cc +++ b/src/config.cc @@ -18,18 +18,18 @@ MainConfig::MainConfig() { searched_envs+=env+", "; searched_envs.erase(searched_envs.end()-2, searched_envs.end()); searched_envs+="]"; - throw std::runtime_error("One of these environment variables needs to point to a writable directory to save configuration." + searched_envs); + throw std::runtime_error("One of these environment variables needs to point to a writable directory to save configuration: " + searched_envs); } boost::property_tree::json_parser::read_json(config_json, cfg); update_config_file(); retrieve_config(); } catch(const std::exception &e) { - Singleton::terminal()->print("Error reading "+ config_json + ": "+e.what()+"\n"); std::stringstream ss; ss << configjson; boost::property_tree::read_json(ss, cfg); retrieve_config(); + JERROR("Error reading "+ config_json + ": "+e.what()+"\n"); // logs will print to cerr when init_log haven't been run yet } } @@ -65,7 +65,7 @@ void MainConfig::retrieve_config() { Singleton::Config::window()->keybindings = cfg.get_child("keybindings"); GenerateSource(); GenerateDirectoryFilter(); - + Singleton::Config::window()->theme_name=cfg.get("gtk_theme.name"); Singleton::Config::window()->theme_variant=cfg.get("gtk_theme.variant"); Singleton::Config::window()->version = cfg.get("version"); @@ -174,11 +174,11 @@ std::vector MainConfig::init_home_path(){ for (auto &env : locations) { ptr=std::getenv(env.c_str()); if (ptr==nullptr) - break; + continue; else if (boost::filesystem::exists(ptr)) { - home /= ".juci"; home /= ptr; + home /= ".juci"; return locations; } }