1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00

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.
This commit is contained in:
Joshua Goins 2025-03-25 16:44:51 -04:00
parent 72eda3e1d0
commit fda12d4a3d
4 changed files with 2 additions and 33 deletions

View file

@ -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;
};

View file

@ -46,12 +46,9 @@ void GameRunner::beginGameExecutable(Profile &profile, const std::optional<Login
void GameRunner::beginVanillaGame(const QString &gameExecutablePath, Profile &profile, const std::optional<LoginAuth> &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<LoginAuth> &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);
});

View file

@ -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()) {

View file

@ -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 {