From fda12d4a3d2b3a14255ab854031431590b33cdc3 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 25 Mar 2025 16:44:51 -0400 Subject: [PATCH] Remove "is logged in" check This only gets in the way, and doesn't really make sense. I think it's fine for the same profile to be used at the same time. --- launcher/include/profile.h | 7 ------- launcher/src/gamerunner.cpp | 9 +-------- launcher/src/profile.cpp | 13 ------------- launcher/ui/Pages/LoginPage.qml | 6 +----- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/launcher/include/profile.h b/launcher/include/profile.h index 411313c..e49a7b2 100644 --- a/launcher/include/profile.h +++ b/launcher/include/profile.h @@ -23,7 +23,6 @@ class Profile : public QObject Q_PROPERTY(QString expansionVersionText READ expansionVersionText NOTIFY gameInstallChanged) Q_PROPERTY(QString dalamudVersionText READ dalamudVersionText NOTIFY gameInstallChanged) Q_PROPERTY(QString wineVersionText READ wineVersionText NOTIFY wineChanged) - Q_PROPERTY(bool loggedIn READ loggedIn NOTIFY loggedInChanged) Q_PROPERTY(QString subtitle READ subtitle NOTIFY gameInstallChanged) Q_PROPERTY(ProfileConfig *config READ config CONSTANT) @@ -99,9 +98,6 @@ public: BootData *bootData() const; GameData *gameData() const; - [[nodiscard]] bool loggedIn() const; - void setLoggedIn(bool value); - [[nodiscard]] QString subtitle() const; ProfileConfig *config() const; @@ -111,7 +107,6 @@ Q_SIGNALS: void winePathChanged(); void accountChanged(); void wineChanged(); - void loggedInChanged(); void hasDirectx9Changed(); private: @@ -139,6 +134,4 @@ private: bool m_dalamudApplicable = false; QString m_frontierUrl; - - bool m_loggedIn = false; }; diff --git a/launcher/src/gamerunner.cpp b/launcher/src/gamerunner.cpp index ab161be..a06b5c3 100644 --- a/launcher/src/gamerunner.cpp +++ b/launcher/src/gamerunner.cpp @@ -46,12 +46,9 @@ void GameRunner::beginGameExecutable(Profile &profile, const std::optional &auth) { - profile.setLoggedIn(true); - const auto gameProcess = new QProcess(this); gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); connect(gameProcess, &QProcess::finished, this, [this, &profile](const int exitCode) { - profile.setLoggedIn(false); Q_UNUSED(exitCode) Q_EMIT m_launcher.gameClosed(&profile); }); @@ -65,8 +62,6 @@ void GameRunner::beginVanillaGame(const QString &gameExecutablePath, Profile &pr void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &profile, const std::optional &auth) { - profile.setLoggedIn(true); - const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud")); @@ -124,15 +119,13 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr #endif auto watcher = new ProcessWatcher(PID); connect(watcher, &ProcessWatcher::finished, this, [this, &profile] { - profile.setLoggedIn(false); Q_EMIT m_launcher.gameClosed(&profile); }); return; } } - // If Dalamud didn't give a valid PID, OK. Let's just do our previous status quo and inidcate we did log out. - profile.setLoggedIn(false); + // If Dalamud didn't give a valid PID, OK. Let's just do our previous status quo and indicate we did log out. Q_EMIT m_launcher.gameClosed(&profile); }); diff --git a/launcher/src/profile.cpp b/launcher/src/profile.cpp index 18d5bd6..5cc0b97 100644 --- a/launcher/src/profile.cpp +++ b/launcher/src/profile.cpp @@ -362,19 +362,6 @@ GameData *Profile::gameData() const return m_gameData; } -bool Profile::loggedIn() const -{ - return m_loggedIn; -} - -void Profile::setLoggedIn(const bool value) -{ - if (m_loggedIn != value) { - m_loggedIn = value; - Q_EMIT loggedInChanged(); - } -} - QString Profile::subtitle() const { if (config()->isBenchmark()) { diff --git a/launcher/ui/Pages/LoginPage.qml b/launcher/ui/Pages/LoginPage.qml index 6faa527..e50bf03 100644 --- a/launcher/ui/Pages/LoginPage.qml +++ b/launcher/ui/Pages/LoginPage.qml @@ -35,10 +35,6 @@ QQC2.Control { return i18n("OTP is required."); } - if (LauncherCore.currentProfile.loggedIn) { - return i18n("Already logged in."); - } - return ""; } @@ -59,7 +55,7 @@ QQC2.Control { return false; } - return !LauncherCore.currentProfile.loggedIn; + return true; } function updateFields(): void {