From 212924437887389d907bd1449ca161360ce999af Mon Sep 17 00:00:00 2001 From: Luna <93695520+LunaisLazier@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:19:39 -0600 Subject: [PATCH] Revert "revert auth parent changes" This reverts commit cbcbda6d4c6ce50c2a88c7b2c84e5d7934ddde99. --- launcher/minecraft/auth/AuthFlow.cpp | 2 +- launcher/minecraft/auth/AuthFlow.h | 5 +---- launcher/minecraft/auth/MinecraftAccount.cpp | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/launcher/minecraft/auth/AuthFlow.cpp b/launcher/minecraft/auth/AuthFlow.cpp index c3a159197..3207cd87e 100644 --- a/launcher/minecraft/auth/AuthFlow.cpp +++ b/launcher/minecraft/auth/AuthFlow.cpp @@ -21,7 +21,7 @@ #include -AuthFlow::AuthFlow(AccountData* data, Action action, QObject* parent, const std::optional password) : Task(parent), m_data(data) +AuthFlow::AuthFlow(AccountData* data, Action action) : Task(), m_data(data) { if (data->type == AccountType::MSA) { if (action == Action::DeviceCode) { diff --git a/launcher/minecraft/auth/AuthFlow.h b/launcher/minecraft/auth/AuthFlow.h index a5aea9fa1..46d07fd06 100644 --- a/launcher/minecraft/auth/AuthFlow.h +++ b/launcher/minecraft/auth/AuthFlow.h @@ -18,10 +18,7 @@ class AuthFlow : public Task { public: enum class Action { Refresh, Login, DeviceCode }; - explicit AuthFlow(AccountData* data, - Action action = Action::Refresh, - QObject* parent = 0, - std::optional password = std::nullopt); + explicit AuthFlow(AccountData* data, Action action = Action::Refresh); virtual ~AuthFlow() = default; void executeTask() override; diff --git a/launcher/minecraft/auth/MinecraftAccount.cpp b/launcher/minecraft/auth/MinecraftAccount.cpp index ea4331c2c..dbd01c844 100644 --- a/launcher/minecraft/auth/MinecraftAccount.cpp +++ b/launcher/minecraft/auth/MinecraftAccount.cpp @@ -138,7 +138,7 @@ shared_qobject_ptr MinecraftAccount::login(bool useDeviceCode, std::op { Q_ASSERT(m_currentTask.get() == nullptr); - m_currentTask.reset(new AuthFlow(&data, useDeviceCode ? AuthFlow::Action::DeviceCode : AuthFlow::Action::Login, this, password)); + m_currentTask.reset(new AuthFlow(&data, useDeviceCode ? AuthFlow::Action::DeviceCode : AuthFlow::Action::Login)); connect(m_currentTask.get(), &Task::succeeded, this, &MinecraftAccount::authSucceeded); connect(m_currentTask.get(), &Task::failed, this, &MinecraftAccount::authFailed); connect(m_currentTask.get(), &Task::aborted, this, [this] { authFailed(tr("Aborted")); }); @@ -152,7 +152,7 @@ shared_qobject_ptr MinecraftAccount::refresh() return m_currentTask; } - m_currentTask.reset(new AuthFlow(&data, AuthFlow::Action::Refresh, this)); + m_currentTask.reset(new AuthFlow(&data, AuthFlow::Action::Refresh)); connect(m_currentTask.get(), &Task::succeeded, this, &MinecraftAccount::authSucceeded); connect(m_currentTask.get(), &Task::failed, this, &MinecraftAccount::authFailed);