diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-04 21:51:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 21:51:00 +0100 |
commit | 8d3463dbddbbcef2d615d596a1bf7421730c9dd6 (patch) | |
tree | 33f4e6b829a578c4bb1ad21d9b21f01f1c717b28 | |
parent | Merge pull request #12568 from t895/actions-button (diff) | |
parent | frontend_common: config: Move WriteIntegerSetting definition to header (diff) | |
download | yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar.gz yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar.bz2 yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar.lz yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar.xz yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.tar.zst yuzu-8d3463dbddbbcef2d615d596a1bf7421730c9dd6.zip |
-rw-r--r-- | src/frontend_common/config.cpp | 11 | ||||
-rw-r--r-- | src/frontend_common/config.h | 16 |
2 files changed, 11 insertions, 16 deletions
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index 51576b4ee..359a0d267 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp @@ -762,17 +762,6 @@ void Config::WriteBooleanSetting(const std::string& key, const bool& value, WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global); } -template <typename T> -std::enable_if_t<std::is_integral_v<T>> Config::WriteIntegerSetting( - const std::string& key, const T& value, const std::optional<T>& default_value, - const std::optional<bool>& use_global) { - 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 Config::WriteDoubleSetting(const std::string& key, const double& value, const std::optional<double>& default_value, const std::optional<bool>& use_global) { 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); |