diff options
Diffstat (limited to 'src/yuzu_cmd/config.cpp')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index f93b76a4f..fc16f0f0c 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | #include <optional> | ||
| 6 | #include <sstream> | 7 | #include <sstream> |
| 7 | 8 | ||
| 8 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | 9 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 |
| @@ -28,11 +29,12 @@ | |||
| 28 | 29 | ||
| 29 | namespace FS = Common::FS; | 30 | namespace FS = Common::FS; |
| 30 | 31 | ||
| 31 | Config::Config() { | 32 | const std::filesystem::path default_config_path = |
| 32 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 33 | FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "sdl2-config.ini"; |
| 33 | sdl2_config_loc = FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "sdl2-config.ini"; | ||
| 34 | sdl2_config = std::make_unique<INIReader>(FS::PathToUTF8String(sdl2_config_loc)); | ||
| 35 | 34 | ||
| 35 | Config::Config(std::optional<std::filesystem::path> config_path) | ||
| 36 | : sdl2_config_loc{config_path.value_or(default_config_path)}, | ||
| 37 | sdl2_config{std::make_unique<INIReader>(FS::PathToUTF8String(sdl2_config_loc))} { | ||
| 36 | Reload(); | 38 | Reload(); |
| 37 | } | 39 | } |
| 38 | 40 | ||