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);