diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-24 17:23:57 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-28 02:01:57 +0100 |
| commit | 9aca7d85aa86a9232a2cd83e867d679c30487059 (patch) | |
| tree | 0161617f7c7a3b3b7164eb8e905d89f7d9bbb009 /src/wx/grok | |
| parent | 3b1ee8690b21ddc5ff53ba3b2ba50270e3c9f9bf (diff) | |
Use boost::filesystem::path for gpu_binary_location().
Diffstat (limited to 'src/wx/grok')
| -rw-r--r-- | src/wx/grok/gpu_config_panel.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wx/grok/gpu_config_panel.h b/src/wx/grok/gpu_config_panel.h index 88163ae0c..a0f2a1f7f 100644 --- a/src/wx/grok/gpu_config_panel.h +++ b/src/wx/grok/gpu_config_panel.h @@ -21,15 +21,15 @@ #pragma once -static std::vector<std::string> get_gpu_names(std::string binary, std::string filename) +static std::vector<std::string> get_gpu_names(boost::filesystem::path binary, boost::filesystem::path filename) { // Execute the GPU listing program and redirect its output to a file - if (std::system((binary + " > " + filename).c_str()) < 0) { + if (std::system((binary.string() + " > " + filename.string()).c_str()) < 0) { return {}; } std::vector<std::string> gpu_names; - std::ifstream file(filename); + std::ifstream file(filename.c_str()); if (file.is_open()) { std::string line; @@ -57,8 +57,8 @@ public: } void update(void) { auto cfg = Config::instance(); - auto lister_binary = cfg->gpu_binary_location() + "/" + "gpu_lister"; - auto lister_file = cfg->gpu_binary_location () + "/" + "gpus.txt"; + auto lister_binary = cfg->gpu_binary_location() / "gpu_lister"; + auto lister_file = cfg->gpu_binary_location () / "gpus.txt"; if (boost::filesystem::exists(lister_binary)) { auto gpu_names = get_gpu_names(lister_binary, lister_file); @@ -160,7 +160,7 @@ private: auto config = Config::instance (); checked_set (_enable_gpu, config->enable_gpu()); - _binary_location->SetPath(config->gpu_binary_location ()); + _binary_location->SetPath(std_to_wx(config->gpu_binary_location().string())); _gpu_list_control->update(); _gpu_list_control->setSelection(config->selected_gpu()); checked_set (_server, config->gpu_license_server()); |
