diff --git a/launcher/include/profile.h b/launcher/include/profile.h index e662643..6058ab8 100644 --- a/launcher/include/profile.h +++ b/launcher/include/profile.h @@ -119,10 +119,7 @@ public: [[nodiscard]] QString accountUuid() const; void setAccount(Account *account); - void readGameData(); - Q_INVOKABLE void readGameVersion(); - void readWineInfo(); - void readDalamudInfo(); + void readGameVersion(); [[nodiscard]] QString expansionVersionText() const; [[nodiscard]] QString dalamudVersionText() const; @@ -177,6 +174,10 @@ Q_SIGNALS: void loggedInChanged(); private: + void readGameData(); + void readWineInfo(); + void readDalamudInfo(); + QString m_uuid; QString m_wineVersion; ProfileConfig *m_config = nullptr; diff --git a/launcher/include/profilemanager.h b/launcher/include/profilemanager.h index 2ec9bb1..e9b435e 100644 --- a/launcher/include/profilemanager.h +++ b/launcher/include/profilemanager.h @@ -46,8 +46,6 @@ public: private: void insertProfile(Profile *profile); - QString getDefaultWinePrefixPath(); - QVector m_profiles; LauncherCore &m_launcher; diff --git a/launcher/src/gameinstaller.cpp b/launcher/src/gameinstaller.cpp index ef8b723..583b8d8 100644 --- a/launcher/src/gameinstaller.cpp +++ b/launcher/src/gameinstaller.cpp @@ -58,6 +58,8 @@ void GameInstaller::installGame() physis_install_game(fileNameStd.c_str(), installDirectoryStd.c_str()); + m_profile.readGameVersion(); + Q_EMIT installFinished(); qInfo(ASTRA_LOG) << "Installed game in" << installDirectory; }); diff --git a/launcher/src/profile.cpp b/launcher/src/profile.cpp index 1157d48..0b90a07 100644 --- a/launcher/src/profile.cpp +++ b/launcher/src/profile.cpp @@ -126,6 +126,7 @@ void Profile::setGamePath(const QString &path) if (m_config->gamePath() != path) { m_config->setGamePath(path); m_config->save(); + readGameVersion(); Q_EMIT gamePathChanged(); } } diff --git a/launcher/src/profilemanager.cpp b/launcher/src/profilemanager.cpp index 91b5f0f..26f704e 100644 --- a/launcher/src/profilemanager.cpp +++ b/launcher/src/profilemanager.cpp @@ -44,10 +44,6 @@ Profile *ProfileManager::addProfile() auto newProfile = new Profile(m_launcher, QUuid::createUuid().toString(), this); newProfile->setName(QStringLiteral("New Profile")); - newProfile->readWineInfo(); - - newProfile->setWinePrefixPath(getDefaultWinePrefixPath()); - insertProfile(newProfile); return newProfile; @@ -65,19 +61,6 @@ void ProfileManager::deleteProfile(Profile *profile) endRemoveRows(); } -QString ProfileManager::getDefaultWinePrefixPath() -{ -#if defined(Q_OS_MACOS) - return QDir::homePath() + "/Library/Application Support/FINAL FANTASY XIV ONLINE/Bottles/published_Final_Fantasy"; -#endif - -#if defined(Q_OS_LINUX) - return QDir::homePath() + QStringLiteral("/.wine"); -#endif - - Q_UNREACHABLE(); -} - QString ProfileManager::getDefaultGamePath(const QString &uuid) { #if defined(Q_OS_WIN) diff --git a/launcher/ui/Setup/InstallProgress.qml b/launcher/ui/Setup/InstallProgress.qml index ae6e8c6..72345be 100644 --- a/launcher/ui/Setup/InstallProgress.qml +++ b/launcher/ui/Setup/InstallProgress.qml @@ -37,7 +37,6 @@ Kirigami.Page { target: gameInstaller function onInstallFinished() { - LauncherCore.currentProfile.readGameVersion(); applicationWindow().checkSetup(); } diff --git a/launcher/ui/Setup/SetupPage.qml b/launcher/ui/Setup/SetupPage.qml index f06f936..74e3b62 100644 --- a/launcher/ui/Setup/SetupPage.qml +++ b/launcher/ui/Setup/SetupPage.qml @@ -64,7 +64,6 @@ Kirigami.Page { onClicked: { LauncherCore.currentProfile.gamePath = profile.gamePath; - LauncherCore.currentProfile.readGameVersion(); applicationWindow().checkSetup(); } }