From a22a025c5bd579d782225cafba1b56896d22e4cd Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 9 Dec 2023 23:28:18 -0600 Subject: core: Use single instance of profile manager --- src/yuzu/multiplayer/lobby.cpp | 11 ++++++----- src/yuzu/multiplayer/lobby.h | 5 ----- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src/yuzu/multiplayer') diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index 603e9ae3d..41692c05b 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp @@ -27,9 +27,9 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list, std::shared_ptr session, Core::System& system_) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), - ui(std::make_unique()), announce_multiplayer_session(session), - profile_manager(std::make_unique()), system{system_}, - room_network{system.GetRoomNetwork()} { + ui(std::make_unique()), + announce_multiplayer_session(session), system{system_}, room_network{ + system.GetRoomNetwork()} { ui->setupUi(this); // setup the watcher for background connections @@ -299,14 +299,15 @@ void Lobby::OnRefreshLobby() { } std::string Lobby::GetProfileUsername() { - const auto& current_user = profile_manager->GetUser(Settings::values.current_user.GetValue()); + const auto& current_user = + system.GetProfileManager().GetUser(Settings::values.current_user.GetValue()); Service::Account::ProfileBase profile{}; if (!current_user.has_value()) { return ""; } - if (!profile_manager->GetProfileBase(*current_user, profile)) { + if (!system.GetProfileManager().GetProfileBase(*current_user, profile)) { return ""; } diff --git a/src/yuzu/multiplayer/lobby.h b/src/yuzu/multiplayer/lobby.h index 2674ae7c3..e78c9cae3 100644 --- a/src/yuzu/multiplayer/lobby.h +++ b/src/yuzu/multiplayer/lobby.h @@ -24,10 +24,6 @@ namespace Core { class System; } -namespace Service::Account { -class ProfileManager; -} - /** * Listing of all public games pulled from services. The lobby should be simple enough for users to * find the game they want to play, and join it. @@ -103,7 +99,6 @@ private: QFutureWatcher room_list_watcher; std::weak_ptr announce_multiplayer_session; - std::unique_ptr profile_manager; QFutureWatcher* watcher; Validation validation; Core::System& system; -- cgit v1.2.3