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 7ddfd822ba..c33488718c 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 7b503ff483..5d2d05e478 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 a232e8970b..27fabef386 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 ae4e389f6c..ed9af0e9fe 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 e22f6166c7..6e910e33e2 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 3811fd602b..d06c4c63f2 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 f67a3d723e..40447093eb 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 89eb9d76c9..73f71c9e33 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 03f266adf5..e126eeea98 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 9cf309a832..4f68260aa5 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 70f067ea70..e562e89e56 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 6f8957280a..85c1dd4a8c 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 cb4df429c9..be4e7997bd 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 d0dddf8647..1b101c9405 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 de2d669b41..4407e65d3f 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 eee5343fbf..0a1724ce4a 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 2ba65c6386..9feec37ff5 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 afd9b36792..575cb89d57 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; };