From 0bbca96087416175098ea8f0b049a5c60e0774b7 Mon Sep 17 00:00:00 2001
From: yuzubot <yuzu@yuzu-emu.org>
Date: Mon, 24 Jul 2023 12:03:10 +0000
Subject: "Merge Tagged PR 10839"

---
 src/yuzu/configuration/config.h | 64 +++++++----------------------------------
 1 file changed, 11 insertions(+), 53 deletions(-)

(limited to 'src/yuzu/configuration/config.h')

diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index 1211389d27..0ac74c8e72 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -52,7 +52,7 @@ public:
     static const std::map<Settings::AntiAliasing, QString> anti_aliasing_texts_map;
     static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map;
     static const std::map<bool, QString> use_docked_mode_texts_map;
-    static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map;
+    static const std::map<Settings::GpuAccuracy, QString> gpu_accuracy_texts_map;
     static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map;
     static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map;
 
@@ -74,7 +74,6 @@ private:
     void ReadKeyboardValues();
     void ReadMouseValues();
     void ReadTouchscreenValues();
-    void ReadMousePanningValues();
     void ReadMotionTouchValues();
     void ReadHidbusValues();
     void ReadIrCameraValues();
@@ -99,13 +98,13 @@ private:
     void ReadUILayoutValues();
     void ReadWebServiceValues();
     void ReadMultiplayerValues();
+    void ReadNetworkValues();
 
     void SaveValues();
     void SavePlayerValue(std::size_t player_index);
     void SaveDebugValues();
     void SaveMouseValues();
     void SaveTouchscreenValues();
-    void SaveMousePanningValues();
     void SaveMotionTouchValues();
     void SaveHidbusValues();
     void SaveIrCameraValues();
@@ -140,18 +139,6 @@ private:
     QVariant ReadSetting(const QString& name) const;
     QVariant ReadSetting(const QString& name, const QVariant& default_value) const;
 
-    /**
-     * Only reads a setting from the qt_config if the current config is a global config, or if the
-     * current config is a custom config and the setting is overriding the global setting. Otherwise
-     * it does nothing.
-     *
-     * @param setting The variable to be modified
-     * @param name The setting's identifier
-     * @param default_value The value to use when the setting is not already present in the config
-     */
-    template <typename Type>
-    void ReadSettingGlobal(Type& setting, const QString& name, const QVariant& default_value) const;
-
     /**
      * Writes a setting to the qt_config.
      *
@@ -166,50 +153,20 @@ private:
     void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value,
                       bool use_global);
 
-    /**
-     * Reads a value from the qt_config and applies it to the setting, using its label and default
-     * value. If the config is a custom config, this will also read the global state of the setting
-     * and apply that information to it.
-     *
-     * @param The setting
-     */
-    template <typename Type, bool ranged>
-    void ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& setting);
-
-    /**
-     * Sets a value to the qt_config using the setting's label and default value. If the config is a
-     * custom config, it will apply the global state, and the custom value if needed.
-     *
-     * @param The setting
-     */
-    template <typename Type, bool ranged>
-    void WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>& setting);
-
-    /**
-     * Reads a value from the qt_config using the setting's label and default value and applies the
-     * value to the setting.
-     *
-     * @param The setting
-     */
-    template <typename Type, bool ranged>
-    void ReadBasicSetting(Settings::Setting<Type, ranged>& setting);
-
-    /** Sets a value from the setting in the qt_config using the setting's label and default value.
-     *
-     * @param The setting
-     */
-    template <typename Type, bool ranged>
-    void WriteBasicSetting(const Settings::Setting<Type, ranged>& setting);
+    void ReadCategory(Settings::Category category);
+    void WriteCategory(Settings::Category category);
+    void ReadSettingGeneric(Settings::BasicSetting* const setting);
+    void WriteSettingGeneric(Settings::BasicSetting* const setting) const;
 
-    ConfigType type;
+    const ConfigType type;
     std::unique_ptr<QSettings> qt_config;
     std::string qt_config_loc;
-    bool global;
+    const bool global;
 };
 
 // These metatype declarations cannot be in common/settings.h because core is devoid of QT
-Q_DECLARE_METATYPE(Settings::CPUAccuracy);
-Q_DECLARE_METATYPE(Settings::GPUAccuracy);
+Q_DECLARE_METATYPE(Settings::CpuAccuracy);
+Q_DECLARE_METATYPE(Settings::GpuAccuracy);
 Q_DECLARE_METATYPE(Settings::FullscreenMode);
 Q_DECLARE_METATYPE(Settings::NvdecEmulation);
 Q_DECLARE_METATYPE(Settings::ResolutionSetup);
@@ -218,3 +175,4 @@ Q_DECLARE_METATYPE(Settings::AntiAliasing);
 Q_DECLARE_METATYPE(Settings::RendererBackend);
 Q_DECLARE_METATYPE(Settings::ShaderBackend);
 Q_DECLARE_METATYPE(Settings::AstcRecompression);
+Q_DECLARE_METATYPE(Settings::AstcDecodeMode);
-- 
cgit v1.2.3-70-g09d2