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:
parent
72eda3e1d0
commit
fda12d4a3d
4 changed files with 2 additions and 33 deletions
|
@ -23,7 +23,6 @@ class Profile : public QObject
|
||||||
Q_PROPERTY(QString expansionVersionText READ expansionVersionText NOTIFY gameInstallChanged)
|
Q_PROPERTY(QString expansionVersionText READ expansionVersionText NOTIFY gameInstallChanged)
|
||||||
Q_PROPERTY(QString dalamudVersionText READ dalamudVersionText NOTIFY gameInstallChanged)
|
Q_PROPERTY(QString dalamudVersionText READ dalamudVersionText NOTIFY gameInstallChanged)
|
||||||
Q_PROPERTY(QString wineVersionText READ wineVersionText NOTIFY wineChanged)
|
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(QString subtitle READ subtitle NOTIFY gameInstallChanged)
|
||||||
Q_PROPERTY(ProfileConfig *config READ config CONSTANT)
|
Q_PROPERTY(ProfileConfig *config READ config CONSTANT)
|
||||||
|
|
||||||
|
@ -99,9 +98,6 @@ public:
|
||||||
BootData *bootData() const;
|
BootData *bootData() const;
|
||||||
GameData *gameData() const;
|
GameData *gameData() const;
|
||||||
|
|
||||||
[[nodiscard]] bool loggedIn() const;
|
|
||||||
void setLoggedIn(bool value);
|
|
||||||
|
|
||||||
[[nodiscard]] QString subtitle() const;
|
[[nodiscard]] QString subtitle() const;
|
||||||
|
|
||||||
ProfileConfig *config() const;
|
ProfileConfig *config() const;
|
||||||
|
@ -111,7 +107,6 @@ Q_SIGNALS:
|
||||||
void winePathChanged();
|
void winePathChanged();
|
||||||
void accountChanged();
|
void accountChanged();
|
||||||
void wineChanged();
|
void wineChanged();
|
||||||
void loggedInChanged();
|
|
||||||
void hasDirectx9Changed();
|
void hasDirectx9Changed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -139,6 +134,4 @@ private:
|
||||||
bool m_dalamudApplicable = false;
|
bool m_dalamudApplicable = false;
|
||||||
|
|
||||||
QString m_frontierUrl;
|
QString m_frontierUrl;
|
||||||
|
|
||||||
bool m_loggedIn = false;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -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)
|
void GameRunner::beginVanillaGame(const QString &gameExecutablePath, Profile &profile, const std::optional<LoginAuth> &auth)
|
||||||
{
|
{
|
||||||
profile.setLoggedIn(true);
|
|
||||||
|
|
||||||
const auto gameProcess = new QProcess(this);
|
const auto gameProcess = new QProcess(this);
|
||||||
gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment());
|
gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment());
|
||||||
connect(gameProcess, &QProcess::finished, this, [this, &profile](const int exitCode) {
|
connect(gameProcess, &QProcess::finished, this, [this, &profile](const int exitCode) {
|
||||||
profile.setLoggedIn(false);
|
|
||||||
Q_UNUSED(exitCode)
|
Q_UNUSED(exitCode)
|
||||||
Q_EMIT m_launcher.gameClosed(&profile);
|
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)
|
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 dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
const QDir configDir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||||
const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud"));
|
const QDir dalamudDir = dataDir.absoluteFilePath(QStringLiteral("dalamud"));
|
||||||
|
@ -124,15 +119,13 @@ void GameRunner::beginDalamudGame(const QString &gameExecutablePath, Profile &pr
|
||||||
#endif
|
#endif
|
||||||
auto watcher = new ProcessWatcher(PID);
|
auto watcher = new ProcessWatcher(PID);
|
||||||
connect(watcher, &ProcessWatcher::finished, this, [this, &profile] {
|
connect(watcher, &ProcessWatcher::finished, this, [this, &profile] {
|
||||||
profile.setLoggedIn(false);
|
|
||||||
Q_EMIT m_launcher.gameClosed(&profile);
|
Q_EMIT m_launcher.gameClosed(&profile);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Dalamud didn't give a valid PID, OK. Let's just do our previous status quo and inidcate we did log out.
|
// If Dalamud didn't give a valid PID, OK. Let's just do our previous status quo and indicate we did log out.
|
||||||
profile.setLoggedIn(false);
|
|
||||||
Q_EMIT m_launcher.gameClosed(&profile);
|
Q_EMIT m_launcher.gameClosed(&profile);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -362,19 +362,6 @@ GameData *Profile::gameData() const
|
||||||
return m_gameData;
|
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
|
QString Profile::subtitle() const
|
||||||
{
|
{
|
||||||
if (config()->isBenchmark()) {
|
if (config()->isBenchmark()) {
|
||||||
|
|
|
@ -35,10 +35,6 @@ QQC2.Control {
|
||||||
return i18n("OTP is required.");
|
return i18n("OTP is required.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LauncherCore.currentProfile.loggedIn) {
|
|
||||||
return i18n("Already logged in.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +55,7 @@ QQC2.Control {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !LauncherCore.currentProfile.loggedIn;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFields(): void {
|
function updateFields(): void {
|
||||||
|
|
Loading…
Add table
Reference in a new issue