diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-06-18 09:52:41 +0200 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-21 16:56:55 +0200 |
commit | ee32b177823b9b8499c9fd188a571884f00cf655 (patch) | |
tree | 32cf65e205a685672a109c4d4bd7edfd75353a34 /src/common/settings_setting.h | |
parent | configure_graphics: Simplify UpdateAPILayout (diff) | |
download | yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.gz yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.bz2 yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.lz yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.xz yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.tar.zst yuzu-ee32b177823b9b8499c9fd188a571884f00cf655.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/settings_setting.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/settings_setting.h b/src/common/settings_setting.h index 658b6328d..f803e4e6e 100644 --- a/src/common/settings_setting.h +++ b/src/common/settings_setting.h @@ -5,6 +5,7 @@ #include <map> #include <optional> +#include <stdexcept> #include <string> #include <typeindex> #include <typeinfo> @@ -169,7 +170,7 @@ public: } else { this->SetValue(static_cast<Type>(std::stoll(input))); } - } catch (std::invalid_argument) { + } catch (std::invalid_argument& e) { this->SetValue(this->GetDefault()); } } @@ -229,9 +230,10 @@ public: * @param category_ Category of the setting AKA INI group */ explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name, - Category category, bool save = true, bool runtime_modifiable = false) + Category category_, bool save_ = true, + bool runtime_modifiable_ = false) requires(!ranged) - : Setting<Type, false>{linkage, default_val, name, category, save, runtime_modifiable} { + : Setting<Type, false>{linkage, default_val, name, category_, save_, runtime_modifiable_} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } virtual ~SwitchableSetting() = default; @@ -247,11 +249,11 @@ public: * @param category_ Category of the setting AKA INI group */ explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val, - const Type& max_val, const std::string& name, Category category, - bool save = true, bool runtime_modifiable = false) + const Type& max_val, const std::string& name, Category category_, + bool save_ = true, bool runtime_modifiable_ = false) requires(ranged) : Setting<Type, true>{linkage, default_val, min_val, max_val, - name, category, save, runtime_modifiable} { + name, category_, save_, runtime_modifiable_} { linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); }); } |