From 493905665c2e9ea200301b44dcee599933f5b62c Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 30 Jul 2021 10:07:32 -0400 Subject: [PATCH] configuration: Add const qualifier where able --- src/yuzu/configuration/configure_audio.cpp | 4 ++-- src/yuzu/configuration/configure_audio.h | 4 ++-- src/yuzu/configuration/configure_cpu.cpp | 2 +- src/yuzu/configuration/configure_cpu.h | 4 ++-- src/yuzu/configuration/configure_cpu_debug.cpp | 2 +- src/yuzu/configuration/configure_cpu_debug.h | 4 ++-- src/yuzu/configuration/configure_debug.cpp | 2 +- src/yuzu/configuration/configure_debug.h | 4 ++-- src/yuzu/configuration/configure_debug_tab.cpp | 5 ++--- src/yuzu/configuration/configure_debug_tab.h | 4 +--- src/yuzu/configuration/configure_general.cpp | 2 +- src/yuzu/configuration/configure_general.h | 4 ++-- src/yuzu/configuration/configure_graphics.cpp | 2 +- src/yuzu/configuration/configure_graphics.h | 4 ++-- src/yuzu/configuration/configure_graphics_advanced.cpp | 2 +- src/yuzu/configuration/configure_graphics_advanced.h | 4 ++-- src/yuzu/configuration/configure_profile_manager.cpp | 2 +- src/yuzu/configuration/configure_profile_manager.h | 4 ++-- 18 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index 7ddfd822b..c33488718 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp @@ -14,7 +14,7 @@ #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_audio.h" -ConfigureAudio::ConfigureAudio(Core::System& system_, QWidget* parent) +ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(std::make_unique()), system{system_} { ui->setupUi(this); @@ -32,7 +32,7 @@ ConfigureAudio::ConfigureAudio(Core::System& system_, QWidget* parent) SetConfiguration(); - const bool is_powered_on = system.IsPoweredOn(); + const bool is_powered_on = system_.IsPoweredOn(); ui->output_sink_combo_box->setEnabled(!is_powered_on); ui->audio_device_combo_box->setEnabled(!is_powered_on); } diff --git a/src/yuzu/configuration/configure_audio.h b/src/yuzu/configuration/configure_audio.h index 7b503ff48..5d2d05e47 100644 --- a/src/yuzu/configuration/configure_audio.h +++ b/src/yuzu/configuration/configure_audio.h @@ -23,7 +23,7 @@ class ConfigureAudio : public QWidget { Q_OBJECT public: - explicit ConfigureAudio(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureAudio(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureAudio() override; void ApplyConfiguration(); @@ -46,5 +46,5 @@ private: std::unique_ptr ui; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index a232e8970..27fabef38 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp @@ -13,7 +13,7 @@ #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_cpu.h" -ConfigureCpu::ConfigureCpu(Core::System& system_, QWidget* parent) +ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureCpu), system{system_} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index ae4e389f6..ed9af0e9f 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h @@ -24,7 +24,7 @@ class ConfigureCpu : public QWidget { Q_OBJECT public: - explicit ConfigureCpu(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureCpu(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureCpu() override; void ApplyConfiguration(); @@ -46,5 +46,5 @@ private: ConfigurationShared::CheckState cpuopt_unsafe_inaccurate_nan; ConfigurationShared::CheckState cpuopt_unsafe_fastmem_check; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp index e22f6166c..6e910e33e 100644 --- a/src/yuzu/configuration/configure_cpu_debug.cpp +++ b/src/yuzu/configuration/configure_cpu_debug.cpp @@ -11,7 +11,7 @@ #include "ui_configure_cpu_debug.h" #include "yuzu/configuration/configure_cpu_debug.h" -ConfigureCpuDebug::ConfigureCpuDebug(Core::System& system_, QWidget* parent) +ConfigureCpuDebug::ConfigureCpuDebug(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureCpuDebug), system{system_} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_cpu_debug.h b/src/yuzu/configuration/configure_cpu_debug.h index 3811fd602..d06c4c63f 100644 --- a/src/yuzu/configuration/configure_cpu_debug.h +++ b/src/yuzu/configuration/configure_cpu_debug.h @@ -19,7 +19,7 @@ class ConfigureCpuDebug : public QWidget { Q_OBJECT public: - explicit ConfigureCpuDebug(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureCpuDebug(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureCpuDebug() override; void ApplyConfiguration(); @@ -32,5 +32,5 @@ private: std::unique_ptr ui; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index f67a3d723..40447093e 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -14,7 +14,7 @@ #include "yuzu/debugger/console.h" #include "yuzu/uisettings.h" -ConfigureDebug::ConfigureDebug(Core::System& system_, QWidget* parent) +ConfigureDebug::ConfigureDebug(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug), system{system_} { ui->setupUi(this); SetConfiguration(); diff --git a/src/yuzu/configuration/configure_debug.h b/src/yuzu/configuration/configure_debug.h index 89eb9d76c..73f71c9e3 100644 --- a/src/yuzu/configuration/configure_debug.h +++ b/src/yuzu/configuration/configure_debug.h @@ -19,7 +19,7 @@ class ConfigureDebug : public QWidget { Q_OBJECT public: - explicit ConfigureDebug(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureDebug(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureDebug() override; void ApplyConfiguration(); @@ -32,5 +32,5 @@ private: std::unique_ptr ui; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_debug_tab.cpp b/src/yuzu/configuration/configure_debug_tab.cpp index 03f266adf..e126eeea9 100644 --- a/src/yuzu/configuration/configure_debug_tab.cpp +++ b/src/yuzu/configuration/configure_debug_tab.cpp @@ -8,10 +8,9 @@ #include "yuzu/configuration/configure_debug.h" #include "yuzu/configuration/configure_debug_tab.h" -ConfigureDebugTab::ConfigureDebugTab(Core::System& system_, QWidget* parent) +ConfigureDebugTab::ConfigureDebugTab(const Core::System& system_, QWidget* parent) : QWidget(parent), - ui(new Ui::ConfigureDebugTab), system{system_}, debug_tab{std::make_unique( - system_, this)}, + ui(new Ui::ConfigureDebugTab), debug_tab{std::make_unique(system_, this)}, cpu_debug_tab{std::make_unique(system_, this)} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_debug_tab.h b/src/yuzu/configuration/configure_debug_tab.h index 9cf309a83..4f68260aa 100644 --- a/src/yuzu/configuration/configure_debug_tab.h +++ b/src/yuzu/configuration/configure_debug_tab.h @@ -22,7 +22,7 @@ class ConfigureDebugTab : public QWidget { Q_OBJECT public: - explicit ConfigureDebugTab(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureDebugTab(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureDebugTab() override; void ApplyConfiguration(); @@ -37,8 +37,6 @@ private: std::unique_ptr ui; - Core::System& system; - std::unique_ptr debug_tab; std::unique_ptr cpu_debug_tab; }; diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 70f067ea7..e562e89e5 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -15,7 +15,7 @@ #include "yuzu/configuration/configure_general.h" #include "yuzu/uisettings.h" -ConfigureGeneral::ConfigureGeneral(Core::System& system_, QWidget* parent) +ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGeneral), system{system_} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h index 6f8957280..85c1dd4a8 100644 --- a/src/yuzu/configuration/configure_general.h +++ b/src/yuzu/configuration/configure_general.h @@ -28,7 +28,7 @@ class ConfigureGeneral : public QWidget { Q_OBJECT public: - explicit ConfigureGeneral(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureGeneral(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureGeneral() override; void SetResetCallback(std::function callback); @@ -49,5 +49,5 @@ private: ConfigurationShared::CheckState use_speed_limit; ConfigurationShared::CheckState use_multi_core; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index cb4df429c..be4e7997b 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -19,7 +19,7 @@ #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_graphics.h" -ConfigureGraphics::ConfigureGraphics(Core::System& system_, QWidget* parent) +ConfigureGraphics::ConfigureGraphics(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGraphics), system{system_} { vulkan_device = Settings::values.vulkan_device.GetValue(); RetrieveVulkanDevices(); diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index d0dddf864..1b101c940 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -26,7 +26,7 @@ class ConfigureGraphics : public QWidget { Q_OBJECT public: - explicit ConfigureGraphics(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureGraphics(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureGraphics() override; void ApplyConfiguration(); @@ -60,5 +60,5 @@ private: u32 vulkan_device{}; Settings::ShaderBackend shader_backend{}; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index de2d669b4..4407e65d3 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -8,7 +8,7 @@ #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_graphics_advanced.h" -ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(Core::System& system_, QWidget* parent) +ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced), system{system_} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h index eee5343fb..0a1724ce4 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.h +++ b/src/yuzu/configuration/configure_graphics_advanced.h @@ -23,7 +23,7 @@ class ConfigureGraphicsAdvanced : public QWidget { Q_OBJECT public: - explicit ConfigureGraphicsAdvanced(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureGraphicsAdvanced() override; void ApplyConfiguration(); @@ -41,5 +41,5 @@ private: ConfigurationShared::CheckState use_asynchronous_shaders; ConfigurationShared::CheckState use_fast_gpu_time; - Core::System& system; + const Core::System& system; }; diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 2ba65c638..9feec37ff 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp @@ -76,7 +76,7 @@ QString GetProfileUsernameFromUser(QWidget* parent, const QString& description_t } } // Anonymous namespace -ConfigureProfileManager::ConfigureProfileManager(Core::System& system_, QWidget* parent) +ConfigureProfileManager::ConfigureProfileManager(const Core::System& system_, QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureProfileManager), profile_manager(std::make_unique()), system{system_} { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_profile_manager.h b/src/yuzu/configuration/configure_profile_manager.h index afd9b3679..575cb89d5 100644 --- a/src/yuzu/configuration/configure_profile_manager.h +++ b/src/yuzu/configuration/configure_profile_manager.h @@ -31,7 +31,7 @@ class ConfigureProfileManager : public QWidget { Q_OBJECT public: - explicit ConfigureProfileManager(Core::System& system_, QWidget* parent = nullptr); + explicit ConfigureProfileManager(const Core::System& system_, QWidget* parent = nullptr); ~ConfigureProfileManager() override; void ApplyConfiguration(); @@ -63,5 +63,5 @@ private: std::unique_ptr profile_manager; - Core::System& system; + const Core::System& system; };