From e51d8243f2f5f09059b01d1c2bd7b80389e8fa6e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 5 Sep 2022 17:49:02 -0400 Subject: [PATCH] Use the unified login interface in tablet version too --- launcher/core/include/launchercore.h | 2 +- launcher/core/src/launchercore.cpp | 10 +++++----- launcher/desktop/src/launcherwindow.cpp | 2 +- launcher/tablet/qml/main.qml | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/launcher/core/include/launchercore.h b/launcher/core/include/launchercore.h index 0d9c7d3..e02c640 100755 --- a/launcher/core/include/launchercore.h +++ b/launcher/core/include/launchercore.h @@ -159,7 +159,7 @@ public: * * The login process is asynchronous. */ - void login(LoginInformation& loginInformation); + Q_INVOKABLE void login(LoginInformation* loginInformation); /* * Attempts to log into a profile without LoginInformation, which may or may not work depending on a combination of diff --git a/launcher/core/src/launchercore.cpp b/launcher/core/src/launchercore.cpp index dae4752..edb5d68 100755 --- a/launcher/core/src/launchercore.cpp +++ b/launcher/core/src/launchercore.cpp @@ -640,11 +640,11 @@ void LauncherCore::readGameData(ProfileSettings& profile) { } } -void LauncherCore::login(LoginInformation& loginInformation) { - if (loginInformation.settings->isSapphire) { - sapphireLauncher->login(loginInformation.settings->lobbyURL, loginInformation); +void LauncherCore::login(LoginInformation* loginInformation) { + if (loginInformation->settings->isSapphire) { + sapphireLauncher->login(loginInformation->settings->lobbyURL, *loginInformation); } else { - squareBoot->checkGateStatus(&loginInformation); + squareBoot->checkGateStatus(loginInformation); } } @@ -709,7 +709,7 @@ bool LauncherCore::autoLogin(ProfileSettings& profile) { } // TODO: when login fails, we need some way to propagate this back? or not? - login(*info); + login(info); return true; } diff --git a/launcher/desktop/src/launcherwindow.cpp b/launcher/desktop/src/launcherwindow.cpp index 4233f21..1b699b9 100644 --- a/launcher/desktop/src/launcherwindow.cpp +++ b/launcher/desktop/src/launcherwindow.cpp @@ -303,7 +303,7 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo } #endif - this->core.login(*info); + this->core.login(info); }); connect(loginButton, &QPushButton::released, [=] { diff --git a/launcher/tablet/qml/main.qml b/launcher/tablet/qml/main.qml index c53dfb4..a6ddb5f 100644 --- a/launcher/tablet/qml/main.qml +++ b/launcher/tablet/qml/main.qml @@ -67,8 +67,7 @@ ApplicationWindow { info.password = passwordField.text info.oneTimePassword = otpField.text - print(info); - core.squareBoot.checkGateStatus(info); + core.login(info); } } } \ No newline at end of file