summaryrefslogtreecommitdiffstats
path: root/src/frontend_common/config.h
diff options
context:
space:
mode:
authort895 <clombardo169@gmail.com>2024-01-03 23:57:20 +0100
committert895 <clombardo169@gmail.com>2024-01-03 23:57:20 +0100
commitbdf87ba0f8a1d6ca985097c8245bda50e70a87b6 (patch)
treefba8ca5dea7c2428024487648c2650674976635e /src/frontend_common/config.h
parentMerge pull request #12554 from german77/directconnect (diff)
downloadyuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.gz
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.bz2
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.lz
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.xz
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.zst
yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.zip
Diffstat (limited to 'src/frontend_common/config.h')
-rw-r--r--src/frontend_common/config.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/frontend_common/config.h b/src/frontend_common/config.h
index 0c4d505b8..b01631649 100644
--- a/src/frontend_common/config.h
+++ b/src/frontend_common/config.h
@@ -157,17 +157,23 @@ protected:
void WriteBooleanSetting(const std::string& key, const bool& value,
const std::optional<bool>& default_value = std::nullopt,
const std::optional<bool>& use_global = std::nullopt);
- template <typename T>
- std::enable_if_t<std::is_integral_v<T>> WriteIntegerSetting(
- const std::string& key, const T& value,
- const std::optional<T>& default_value = std::nullopt,
- const std::optional<bool>& use_global = std::nullopt);
void WriteDoubleSetting(const std::string& key, const double& value,
const std::optional<double>& default_value = std::nullopt,
const std::optional<bool>& use_global = std::nullopt);
void WriteStringSetting(const std::string& key, const std::string& value,
const std::optional<std::string>& default_value = std::nullopt,
const std::optional<bool>& use_global = std::nullopt);
+ template <typename T>
+ std::enable_if_t<std::is_integral_v<T>> WriteIntegerSetting(
+ const std::string& key, const T& value,
+ const std::optional<T>& default_value = std::nullopt,
+ const std::optional<bool>& use_global = std::nullopt) {
+ std::optional<std::string> string_default = std::nullopt;
+ if (default_value.has_value()) {
+ string_default = std::make_optional(ToString(default_value.value()));
+ }
+ WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global);
+ }
void ReadCategory(Settings::Category category);
void WriteCategory(Settings::Category category);