From 3c63cecb968f0eab285afc6428c51c9ab3fb67d4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 25 Oct 2018 16:43:42 -0400 Subject: configure_system: Make public slots private These are only used within this class, so we can make them private to keep their use contained. This also gets rid of the pre-Qt5 'slot' identifier, since Qt 5's connection syntax doesn't require a function to be declared a slot anymore. --- src/yuzu/configuration/configure_system.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/yuzu/configuration/configure_system.h') diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index b73e0719c..a30ab8499 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -34,23 +34,21 @@ public: void applyConfiguration(); void setConfiguration(); - void PopulateUserList(); - void UpdateCurrentUser(); +private: + void ReadSystemSettings(); + std::string GetAccountUsername(Service::Account::UUID uuid) const; -public slots: void updateBirthdayComboBox(int birthmonth_index); void refreshConsoleID(); + void PopulateUserList(); + void UpdateCurrentUser(); void SelectUser(const QModelIndex& index); void AddUser(); void RenameUser(); void DeleteUser(); void SetUserImage(); -private: - void ReadSystemSettings(); - std::string GetAccountUsername(Service::Account::UUID uuid) const; - QVBoxLayout* layout; QTreeView* tree_view; QStandardItemModel* item_model; -- cgit v1.2.3 From 2347e1b8c530fb1cf88e61c40b2369746d4636a8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 25 Oct 2018 16:45:13 -0400 Subject: configure_system: Add missing override specifier on the destructor --- src/yuzu/configuration/configure_system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_system.h') diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index a30ab8499..ea724e317 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -29,7 +29,7 @@ class ConfigureSystem : public QWidget { public: explicit ConfigureSystem(QWidget* parent = nullptr); - ~ConfigureSystem(); + ~ConfigureSystem() override; void applyConfiguration(); void setConfiguration(); -- cgit v1.2.3 From a6addb5332eca0cecd3baca0c9660805396d235b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 25 Oct 2018 16:47:09 -0400 Subject: configure_system: Amend function casing --- src/yuzu/configuration/configure_system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/configuration/configure_system.h') diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index ea724e317..86269ccd5 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -38,8 +38,8 @@ private: void ReadSystemSettings(); std::string GetAccountUsername(Service::Account::UUID uuid) const; - void updateBirthdayComboBox(int birthmonth_index); - void refreshConsoleID(); + void UpdateBirthdayComboBox(int birthmonth_index); + void RefreshConsoleID(); void PopulateUserList(); void UpdateCurrentUser(); -- cgit v1.2.3 From bf7da804c5435a589909466d45e5ddf9a772cd45 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 25 Oct 2018 16:52:21 -0400 Subject: configure_system: Default initialize member variables These should be initialized to deterministic values so it's easier to catch improper behavior, as it'll always be reproducable, instead of performing uninitialized reads. --- src/yuzu/configuration/configure_system.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/yuzu/configuration/configure_system.h') diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index 86269ccd5..0d15d9ac4 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -57,11 +57,12 @@ private: std::vector> list_items; std::unique_ptr ui; - bool enabled; + bool enabled = false; - int birthmonth, birthday; - int language_index; - int sound_index; + int birthmonth = 0; + int birthday = 0; + int language_index = 0; + int sound_index = 0; std::unique_ptr profile_manager; }; -- cgit v1.2.3 From 5172354e29fed02cbceee8d55564d32ca361d58f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 25 Oct 2018 16:58:37 -0400 Subject: configure_system: Make GetAccountUsername() an internal function We can just make the function accept an arbitrary ProfileManager reference and operate on that instead of tying the function to the class itself. This allows us to keep the function internal to the cpp file and removes the need to forward declare the UUID struct. --- src/yuzu/configuration/configure_system.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/yuzu/configuration/configure_system.h') diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index 0d15d9ac4..07764e1f7 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -9,17 +9,16 @@ #include #include -namespace Service::Account { -class ProfileManager; -struct UUID; -} // namespace Service::Account - class QGraphicsScene; class QStandardItem; class QStandardItemModel; class QTreeView; class QVBoxLayout; +namespace Service::Account { +class ProfileManager; +} + namespace Ui { class ConfigureSystem; } @@ -36,7 +35,6 @@ public: private: void ReadSystemSettings(); - std::string GetAccountUsername(Service::Account::UUID uuid) const; void UpdateBirthdayComboBox(int birthmonth_index); void RefreshConsoleID(); -- cgit v1.2.3