diff options
author | german77 <juangerman-13@hotmail.com> | 2023-12-09 23:28:18 -0600 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-12-10 11:29:43 -0600 |
commit | a22a025c5bd579d782225cafba1b56896d22e4cd (patch) | |
tree | 2dc2cb8f3a603c91b24b71cc308489f6328633bf /src/yuzu/applets/qt_profile_select.cpp | |
parent | 875568bb3e34725578f7fa3661c8bad89f23a173 (diff) |
core: Use single instance of profile manager
Diffstat (limited to 'src/yuzu/applets/qt_profile_select.cpp')
-rw-r--r-- | src/yuzu/applets/qt_profile_select.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp index 1f3f23038..79162a491 100644 --- a/src/yuzu/applets/qt_profile_select.cpp +++ b/src/yuzu/applets/qt_profile_select.cpp @@ -14,6 +14,8 @@ #include "common/fs/path_util.h" #include "common/string_util.h" #include "core/constants.h" +#include "core/core.h" +#include "core/hle/service/acc/profile_manager.h" #include "yuzu/applets/qt_profile_select.h" #include "yuzu/main.h" #include "yuzu/util/controller_navigation.h" @@ -47,9 +49,9 @@ QPixmap GetIcon(Common::UUID uuid) { } // Anonymous namespace QtProfileSelectionDialog::QtProfileSelectionDialog( - Core::HID::HIDCore& hid_core, QWidget* parent, + Core::System& system, QWidget* parent, const Core::Frontend::ProfileSelectParameters& parameters) - : QDialog(parent), profile_manager(std::make_unique<Service::Account::ProfileManager>()) { + : QDialog(parent), profile_manager{system.GetProfileManager()} { outer_layout = new QVBoxLayout; instruction_label = new QLabel(); @@ -68,7 +70,7 @@ QtProfileSelectionDialog::QtProfileSelectionDialog( tree_view = new QTreeView; item_model = new QStandardItemModel(tree_view); tree_view->setModel(item_model); - controller_navigation = new ControllerNavigation(hid_core, this); + controller_navigation = new ControllerNavigation(system.HIDCore(), this); tree_view->setAlternatingRowColors(true); tree_view->setSelectionMode(QHeaderView::SingleSelection); @@ -106,10 +108,10 @@ QtProfileSelectionDialog::QtProfileSelectionDialog( SelectUser(tree_view->currentIndex()); }); - const auto& profiles = profile_manager->GetAllUsers(); + const auto& profiles = profile_manager.GetAllUsers(); for (const auto& user : profiles) { Service::Account::ProfileBase profile{}; - if (!profile_manager->GetProfileBase(user, profile)) + if (!profile_manager.GetProfileBase(user, profile)) continue; const auto username = Common::StringFromFixedZeroTerminatedBuffer( @@ -134,7 +136,7 @@ QtProfileSelectionDialog::~QtProfileSelectionDialog() { int QtProfileSelectionDialog::exec() { // Skip profile selection when there's only one. - if (profile_manager->GetUserCount() == 1) { + if (profile_manager.GetUserCount() == 1) { user_index = 0; return QDialog::Accepted; } |