diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 25 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 6 |
2 files changed, 2 insertions, 29 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 1a0f75373..6ea529171 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -311,16 +311,6 @@ void Config::WriteBasicSetting(const Settings::BasicSetting<std::string>& settin | |||
| 311 | qt_config->setValue(name, QString::fromStdString(value)); | 311 | qt_config->setValue(name, QString::fromStdString(value)); |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | // Explicit float definition: use a double as Qt doesn't write legible floats to config files | ||
| 315 | template <> | ||
| 316 | void Config::WriteBasicSetting(const Settings::BasicSetting<float>& setting) { | ||
| 317 | const QString name = QString::fromStdString(setting.GetLabel()); | ||
| 318 | const double value = setting.GetValue(); | ||
| 319 | qt_config->setValue(name + QStringLiteral("/default"), | ||
| 320 | setting.GetValue() == setting.GetDefault()); | ||
| 321 | qt_config->setValue(name, value); | ||
| 322 | } | ||
| 323 | |||
| 324 | template <typename Type> | 314 | template <typename Type> |
| 325 | void Config::WriteBasicSetting(const Settings::BasicSetting<Type>& setting) { | 315 | void Config::WriteBasicSetting(const Settings::BasicSetting<Type>& setting) { |
| 326 | const QString name = QString::fromStdString(setting.GetLabel()); | 316 | const QString name = QString::fromStdString(setting.GetLabel()); |
| @@ -329,21 +319,6 @@ void Config::WriteBasicSetting(const Settings::BasicSetting<Type>& setting) { | |||
| 329 | qt_config->setValue(name, value); | 319 | qt_config->setValue(name, value); |
| 330 | } | 320 | } |
| 331 | 321 | ||
| 332 | // Explicit float definition: use a double as Qt doesn't write legible floats to config files | ||
| 333 | template <> | ||
| 334 | void Config::WriteGlobalSetting(const Settings::Setting<float>& setting) { | ||
| 335 | const QString name = QString::fromStdString(setting.GetLabel()); | ||
| 336 | const double value = setting.GetValue(global); | ||
| 337 | if (!global) { | ||
| 338 | qt_config->setValue(name + QStringLiteral("/use_global"), setting.UsingGlobal()); | ||
| 339 | } | ||
| 340 | if (global || !setting.UsingGlobal()) { | ||
| 341 | qt_config->setValue(name + QStringLiteral("/default"), | ||
| 342 | setting.GetValue(global) == setting.GetDefault()); | ||
| 343 | qt_config->setValue(name, value); | ||
| 344 | } | ||
| 345 | } | ||
| 346 | |||
| 347 | template <typename Type> | 322 | template <typename Type> |
| 348 | void Config::WriteGlobalSetting(const Settings::Setting<Type>& setting) { | 323 | void Config::WriteGlobalSetting(const Settings::Setting<Type>& setting) { |
| 349 | const QString name = QString::fromStdString(setting.GetLabel()); | 324 | const QString name = QString::fromStdString(setting.GetLabel()); |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 325584a1a..23ada3f92 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -242,17 +242,15 @@ static const std::array<int, 8> keyboard_mods{ | |||
| 242 | }; | 242 | }; |
| 243 | 243 | ||
| 244 | template <> | 244 | template <> |
| 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float>& setting) { | ||
| 246 | setting = sdl2_config->GetReal(group, setting.GetLabel(), setting.GetDefault()); | ||
| 247 | } | ||
| 248 | template <> | ||
| 249 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) { | 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) { |
| 250 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); | 246 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); |
| 251 | } | 247 | } |
| 248 | |||
| 252 | template <> | 249 | template <> |
| 253 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) { | 250 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) { |
| 254 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); | 251 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); |
| 255 | } | 252 | } |
| 253 | |||
| 256 | template <typename Type> | 254 | template <typename Type> |
| 257 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) { | 255 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) { |
| 258 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), | 256 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), |