summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-06-18 09:52:41 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-07-21 16:56:55 +0200
commitee32b177823b9b8499c9fd188a571884f00cf655 (patch)
tree32cf65e205a685672a109c4d4bd7edfd75353a34 /src/common
parentconfigure_graphics: Simplify UpdateAPILayout (diff)
downloadyuzu-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 'src/common')
-rw-r--r--src/common/settings_common.h2
-rw-r--r--src/common/settings_setting.h14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/common/settings_common.h b/src/common/settings_common.h
index 4d6d3021e..2b5c72f41 100644
--- a/src/common/settings_common.h
+++ b/src/common/settings_common.h
@@ -178,7 +178,7 @@ public:
*
* @returns The setting's category
*/
- [[nodiscard]] Category Category() const;
+ [[nodiscard]] enum Category Category() const;
/**
* Returns the label this setting was created with.
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); });
}