remove task parent from constuctor
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <Application.h>
|
||||
|
||||
AuthFlow::AuthFlow(AccountData* data, Action action, QObject* parent) : Task(parent), m_data(data)
|
||||
AuthFlow::AuthFlow(AccountData* data, Action action) : Task(), m_data(data)
|
||||
{
|
||||
if (data->type == AccountType::MSA) {
|
||||
if (action == Action::DeviceCode) {
|
||||
|
||||
@@ -17,7 +17,7 @@ class AuthFlow : public Task {
|
||||
public:
|
||||
enum class Action { Refresh, Login, DeviceCode };
|
||||
|
||||
explicit AuthFlow(AccountData* data, Action action = Action::Refresh, QObject* parent = 0);
|
||||
explicit AuthFlow(AccountData* data, Action action = Action::Refresh);
|
||||
virtual ~AuthFlow() = default;
|
||||
|
||||
void executeTask() override;
|
||||
|
||||
@@ -121,7 +121,7 @@ shared_qobject_ptr<AuthFlow> MinecraftAccount::login(bool useDeviceCode)
|
||||
{
|
||||
Q_ASSERT(m_currentTask.get() == nullptr);
|
||||
|
||||
m_currentTask.reset(new AuthFlow(&data, useDeviceCode ? AuthFlow::Action::DeviceCode : AuthFlow::Action::Login, this));
|
||||
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")); });
|
||||
@@ -135,7 +135,7 @@ shared_qobject_ptr<AuthFlow> 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);
|
||||
|
||||
Reference in New Issue
Block a user