From a6c4f5386279ec97af3a212d9f190846879fe123 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 17 Mar 2025 18:47:32 -0400 Subject: [PATCH] Save account and profile config changes again --- launcher/include/account.h | 1 + launcher/include/profile.h | 1 + launcher/src/account.cpp | 7 ++++++- launcher/src/profile.cpp | 7 ++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/launcher/include/account.h b/launcher/include/account.h index e052208..ff31bbe 100644 --- a/launcher/include/account.h +++ b/launcher/include/account.h @@ -20,6 +20,7 @@ class Account : public QObject public: explicit Account(const QString &key, QObject *parent = nullptr); + ~Account() override; enum GameLicense { WindowsStandalone, diff --git a/launcher/include/profile.h b/launcher/include/profile.h index c7cbeac..411313c 100644 --- a/launcher/include/profile.h +++ b/launcher/include/profile.h @@ -29,6 +29,7 @@ class Profile : public QObject public: explicit Profile(const QString &key, QObject *parent = nullptr); + ~Profile() override; enum WineType { BuiltIn, diff --git a/launcher/src/account.cpp b/launcher/src/account.cpp index 74c730e..199741a 100644 --- a/launcher/src/account.cpp +++ b/launcher/src/account.cpp @@ -15,12 +15,17 @@ using namespace Qt::StringLiterals; Account::Account(const QString &key, QObject *parent) : QObject(parent) - , m_config(new AccountConfig(key)) + , m_config(new AccountConfig(key, this)) , m_key(key) { fetchPassword(); } +Account::~Account() +{ + m_config->save(); +} + QString Account::uuid() const { return m_key; diff --git a/launcher/src/profile.cpp b/launcher/src/profile.cpp index 585cd6c..18d5bd6 100644 --- a/launcher/src/profile.cpp +++ b/launcher/src/profile.cpp @@ -19,7 +19,7 @@ using namespace Qt::StringLiterals; Profile::Profile(const QString &key, QObject *parent) : QObject(parent) , m_uuid(key) - , m_config(new ProfileConfig(key)) + , m_config(new ProfileConfig(key, this)) { readGameVersion(); readWineInfo(); @@ -30,6 +30,11 @@ Profile::Profile(const QString &key, QObject *parent) connect(m_config, &ProfileConfig::GamePathChanged, this, &Profile::hasDirectx9Changed); } +Profile::~Profile() +{ + m_config->save(); +} + void Profile::readDalamudInfo() { const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);