From d878a6a1f26da1a8c4821fce005cf627517238be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Thu, 1 Oct 2020 17:56:23 +0200 Subject: [PATCH] move config file to config directory --- src/config.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index fd40590..3d31e98 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -8,20 +8,10 @@ Config::Config() { const auto home_path = filesystem::get_home_path(); - if(std::getenv("XDG_RUNTIME_DIR") != nullptr) { - if(auto ptr = std::getenv("XDG_CONFIG_HOME")) { - boost::filesystem::path config_dir(ptr); - home_juci_path = config_dir / "juci"; - } - else { - home_juci_path = home_path / ".config" / "juci"; - } - juci_config_file = home_juci_path / "config.json"; - return; - } if(home_path.empty()) throw std::runtime_error("Could not find home path"); - home_juci_path = home_path / ".juci"; + + home_juci_path = filesystem::get_config_path() / "juci"; juci_config_file = home_juci_path / "config.json"; }