From f3253d0f1432eb290f2753c187121f874b106a8e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Dec 2018 14:06:39 -0500 Subject: yuzu/configuration/configure_input: Default destructor in the cpp file The previous code could potentially be a compilation issue waiting to occur, given we forward declare the type for a std::unique_ptr. If the complete definition of the forward declared type isn't visible in a translation unit that the class is used in, then it would fail to compile. Defaulting the destructor in a cpp file ensures the std::unique_ptr's destructor is only invoked where its complete type is known. --- src/yuzu/configuration/configure_input.cpp | 2 ++ src/yuzu/configuration/configure_input.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index 0527d098c..830d26115 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp @@ -88,6 +88,8 @@ ConfigureInput::ConfigureInput(QWidget* parent) [this] { CallConfigureDialog(*this); }); } +ConfigureInput::~ConfigureInput() = default; + void ConfigureInput::OnDockedModeChanged(bool last_state, bool new_state) { if (ui->use_docked_mode->isChecked() && ui->handheld_connected->isChecked()) { ui->handheld_connected->setChecked(false); diff --git a/src/yuzu/configuration/configure_input.h b/src/yuzu/configuration/configure_input.h index e8723dfcb..1649e4c0b 100644 --- a/src/yuzu/configuration/configure_input.h +++ b/src/yuzu/configuration/configure_input.h @@ -25,6 +25,7 @@ class ConfigureInput : public QWidget { public: explicit ConfigureInput(QWidget* parent = nullptr); + ~ConfigureInput() override; /// Save all button configurations to settings file void applyConfiguration(); -- cgit v1.2.3 From eabfb7730de3277cc12f870db2ecd5a6593aab11 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Dec 2018 14:10:28 -0500 Subject: yuzu/configuration: Add missing override specifiers to configuration-related classes Resolves trivial compiler warnings. --- src/yuzu/configuration/configure_audio.h | 2 +- src/yuzu/configuration/configure_debug.h | 2 +- src/yuzu/configuration/configure_dialog.h | 2 +- src/yuzu/configuration/configure_gamelist.h | 2 +- src/yuzu/configuration/configure_general.h | 2 +- src/yuzu/configuration/configure_graphics.h | 2 +- src/yuzu/configuration/configure_web.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/yuzu/configuration/configure_audio.h b/src/yuzu/configuration/configure_audio.h index 207f9dfb3..b55b53974 100644 --- a/src/yuzu/configuration/configure_audio.h +++ b/src/yuzu/configuration/configure_audio.h @@ -16,7 +16,7 @@ class ConfigureAudio : public QWidget { public: explicit ConfigureAudio(QWidget* parent = nullptr); - ~ConfigureAudio(); + ~ConfigureAudio() override; void applyConfiguration(); void retranslateUi(); diff --git a/src/yuzu/configuration/configure_debug.h b/src/yuzu/configuration/configure_debug.h index d167eb996..ac0d04acb 100644 --- a/src/yuzu/configuration/configure_debug.h +++ b/src/yuzu/configuration/configure_debug.h @@ -16,7 +16,7 @@ class ConfigureDebug : public QWidget { public: explicit ConfigureDebug(QWidget* parent = nullptr); - ~ConfigureDebug(); + ~ConfigureDebug() override; void applyConfiguration(); diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index bbbdacc29..df23a0801 100644 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h @@ -18,7 +18,7 @@ class ConfigureDialog : public QDialog { public: explicit ConfigureDialog(QWidget* parent, const HotkeyRegistry& registry); - ~ConfigureDialog(); + ~ConfigureDialog() override; void applyConfiguration(); diff --git a/src/yuzu/configuration/configure_gamelist.h b/src/yuzu/configuration/configure_gamelist.h index bbf7e25f1..bf3f1cdfa 100644 --- a/src/yuzu/configuration/configure_gamelist.h +++ b/src/yuzu/configuration/configure_gamelist.h @@ -16,7 +16,7 @@ class ConfigureGameList : public QWidget { public: explicit ConfigureGameList(QWidget* parent = nullptr); - ~ConfigureGameList(); + ~ConfigureGameList() override; void applyConfiguration(); diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h index 4770034cc..59738af40 100644 --- a/src/yuzu/configuration/configure_general.h +++ b/src/yuzu/configuration/configure_general.h @@ -18,7 +18,7 @@ class ConfigureGeneral : public QWidget { public: explicit ConfigureGeneral(QWidget* parent = nullptr); - ~ConfigureGeneral(); + ~ConfigureGeneral() override; void PopulateHotkeyList(const HotkeyRegistry& registry); void applyConfiguration(); diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 9bda26fd6..8688003e4 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -16,7 +16,7 @@ class ConfigureGraphics : public QWidget { public: explicit ConfigureGraphics(QWidget* parent = nullptr); - ~ConfigureGraphics(); + ~ConfigureGraphics() override; void applyConfiguration(); diff --git a/src/yuzu/configuration/configure_web.h b/src/yuzu/configuration/configure_web.h index 7741ab95d..61d8149f6 100644 --- a/src/yuzu/configuration/configure_web.h +++ b/src/yuzu/configuration/configure_web.h @@ -17,7 +17,7 @@ class ConfigureWeb : public QWidget { public: explicit ConfigureWeb(QWidget* parent = nullptr); - ~ConfigureWeb(); + ~ConfigureWeb() override; void applyConfiguration(); void retranslateUi(); -- cgit v1.2.3 From 195cad96355f8d42b84b5c5c58bb4ed34cd77074 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Dec 2018 14:14:32 -0500 Subject: yuzu/configuration: Make slots private where applicable These slots are only ever attached to event handling mechanisms within the class itself, they're never used externally. Because of this, we can make the functions private. This also removes redundant usages of the private access specifier. --- src/yuzu/configuration/configure_audio.h | 3 +-- src/yuzu/configuration/configure_debug.h | 1 - src/yuzu/configuration/configure_dialog.h | 1 - src/yuzu/configuration/configure_graphics.h | 1 - src/yuzu/configuration/configure_web.h | 3 +-- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/yuzu/configuration/configure_audio.h b/src/yuzu/configuration/configure_audio.h index b55b53974..8771421c0 100644 --- a/src/yuzu/configuration/configure_audio.h +++ b/src/yuzu/configuration/configure_audio.h @@ -21,10 +21,9 @@ public: void applyConfiguration(); void retranslateUi(); -public slots: +private: void updateAudioDevices(int sink_index); -private: void setConfiguration(); void setOutputSinkFromSinkID(); void setAudioDeviceFromDeviceID(); diff --git a/src/yuzu/configuration/configure_debug.h b/src/yuzu/configuration/configure_debug.h index ac0d04acb..c6420b18c 100644 --- a/src/yuzu/configuration/configure_debug.h +++ b/src/yuzu/configuration/configure_debug.h @@ -23,6 +23,5 @@ public: private: void setConfiguration(); -private: std::unique_ptr ui; }; diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index df23a0801..f6df7b827 100644 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h @@ -25,6 +25,5 @@ public: private: void setConfiguration(); -private: std::unique_ptr ui; }; diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 8688003e4..d6ffc6fde 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -23,7 +23,6 @@ public: private: void setConfiguration(); -private: std::unique_ptr ui; QColor bg_color; }; diff --git a/src/yuzu/configuration/configure_web.h b/src/yuzu/configuration/configure_web.h index 61d8149f6..7752ae4a1 100644 --- a/src/yuzu/configuration/configure_web.h +++ b/src/yuzu/configuration/configure_web.h @@ -22,13 +22,12 @@ public: void applyConfiguration(); void retranslateUi(); -public slots: +private: void RefreshTelemetryID(); void OnLoginChanged(); void VerifyLogin(); void OnLoginVerified(); -private: void setConfiguration(); bool user_verified = true; -- cgit v1.2.3