diff options
| author | 2024-01-03 17:57:20 -0500 | |
|---|---|---|
| committer | 2024-01-03 17:57:20 -0500 | |
| commit | bdf87ba0f8a1d6ca985097c8245bda50e70a87b6 (patch) | |
| tree | fba8ca5dea7c2428024487648c2650674976635e /src | |
| parent | Merge pull request #12554 from german77/directconnect (diff) | |
| download | yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.gz yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.tar.xz yuzu-bdf87ba0f8a1d6ca985097c8245bda50e70a87b6.zip | |
frontend_common: config: Move WriteIntegerSetting definition to header
Fixes a compiler error where the compiler could not see the definition of the method in qt_config and others.
Diffstat (limited to 'src')
| -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, | |||
| 762 | WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global); | 762 | WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global); |
| 763 | } | 763 | } |
| 764 | 764 | ||
| 765 | template <typename T> | ||
| 766 | std::enable_if_t<std::is_integral_v<T>> Config::WriteIntegerSetting( | ||
| 767 | const std::string& key, const T& value, const std::optional<T>& default_value, | ||
| 768 | const std::optional<bool>& use_global) { | ||
| 769 | std::optional<std::string> string_default = std::nullopt; | ||
| 770 | if (default_value.has_value()) { | ||
| 771 | string_default = std::make_optional(ToString(default_value.value())); | ||
| 772 | } | ||
| 773 | WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global); | ||
| 774 | } | ||
| 775 | |||
| 776 | void Config::WriteDoubleSetting(const std::string& key, const double& value, | 765 | void Config::WriteDoubleSetting(const std::string& key, const double& value, |
| 777 | const std::optional<double>& default_value, | 766 | const std::optional<double>& default_value, |
| 778 | const std::optional<bool>& use_global) { | 767 | 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: | |||
| 157 | void WriteBooleanSetting(const std::string& key, const bool& value, | 157 | void WriteBooleanSetting(const std::string& key, const bool& value, |
| 158 | const std::optional<bool>& default_value = std::nullopt, | 158 | const std::optional<bool>& default_value = std::nullopt, |
| 159 | const std::optional<bool>& use_global = std::nullopt); | 159 | const std::optional<bool>& use_global = std::nullopt); |
| 160 | template <typename T> | ||
| 161 | std::enable_if_t<std::is_integral_v<T>> WriteIntegerSetting( | ||
| 162 | const std::string& key, const T& value, | ||
| 163 | const std::optional<T>& default_value = std::nullopt, | ||
| 164 | const std::optional<bool>& use_global = std::nullopt); | ||
| 165 | void WriteDoubleSetting(const std::string& key, const double& value, | 160 | void WriteDoubleSetting(const std::string& key, const double& value, |
| 166 | const std::optional<double>& default_value = std::nullopt, | 161 | const std::optional<double>& default_value = std::nullopt, |
| 167 | const std::optional<bool>& use_global = std::nullopt); | 162 | const std::optional<bool>& use_global = std::nullopt); |
| 168 | void WriteStringSetting(const std::string& key, const std::string& value, | 163 | void WriteStringSetting(const std::string& key, const std::string& value, |
| 169 | const std::optional<std::string>& default_value = std::nullopt, | 164 | const std::optional<std::string>& default_value = std::nullopt, |
| 170 | const std::optional<bool>& use_global = std::nullopt); | 165 | const std::optional<bool>& use_global = std::nullopt); |
| 166 | template <typename T> | ||
| 167 | std::enable_if_t<std::is_integral_v<T>> WriteIntegerSetting( | ||
| 168 | const std::string& key, const T& value, | ||
| 169 | const std::optional<T>& default_value = std::nullopt, | ||
| 170 | const std::optional<bool>& use_global = std::nullopt) { | ||
| 171 | std::optional<std::string> string_default = std::nullopt; | ||
| 172 | if (default_value.has_value()) { | ||
| 173 | string_default = std::make_optional(ToString(default_value.value())); | ||
| 174 | } | ||
| 175 | WritePreparedSetting(key, AdjustOutputString(ToString(value)), string_default, use_global); | ||
| 176 | } | ||
| 171 | 177 | ||
| 172 | void ReadCategory(Settings::Category category); | 178 | void ReadCategory(Settings::Category category); |
| 173 | void WriteCategory(Settings::Category category); | 179 | void WriteCategory(Settings::Category category); |