diff options
author | saturneric <[email protected]> | 2024-01-15 17:02:40 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-15 17:02:40 +0000 |
commit | d54f52ce70cba15f5199e93d3c6fb122143b0526 (patch) | |
tree | f75224f8d020c4c7498bd1ffb97c834e12ec8a2c /src/init.cpp | |
parent | fix: clean up useless code and make life easier (diff) | |
download | GpgFrontend-d54f52ce70cba15f5199e93d3c6fb122143b0526.tar.gz GpgFrontend-d54f52ce70cba15f5199e93d3c6fb122143b0526.zip |
refactor: remove libconfig++ form project
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/init.cpp b/src/init.cpp index e82bccd1..3720056e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -76,21 +76,24 @@ void InitLoggingSystem(const GFCxtSPtr &ctx) { void InitGlobalPathEnv() { // read settings bool use_custom_gnupg_install_path = - GlobalSettingStation::GetInstance().LookupSettings( - "general.use_custom_gnupg_install_path", false); + GlobalSettingStation::GetInstance() + .GetSettings() + .value("general/use_custom_gnupg_install_path", false) + .toBool(); - std::string custom_gnupg_install_path = - GlobalSettingStation::GetInstance().LookupSettings( - "general.custom_gnupg_install_path", std::string{}); + QString custom_gnupg_install_path = + GlobalSettingStation::GetInstance() + .GetSettings() + .value("general/custom_gnupg_install_path") + .toString(); // add custom gnupg install path into env $PATH - if (use_custom_gnupg_install_path && !custom_gnupg_install_path.empty()) { - std::string path_value = getenv("PATH"); + if (use_custom_gnupg_install_path && !custom_gnupg_install_path.isEmpty()) { + QString path_value = getenv("PATH"); GF_MAIN_LOG_DEBUG("Current System PATH: {}", path_value); setenv("PATH", - ((std::filesystem::path{custom_gnupg_install_path}).u8string() + - ":" + path_value) - .c_str(), + (QDir(custom_gnupg_install_path).absolutePath() + ":" + path_value) + .toUtf8(), 1); std::string modified_path_value = getenv("PATH"); GF_MAIN_LOG_DEBUG("Modified System PATH: {}", modified_path_value); |