2023-08-05 22:14:05 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
#include "profile.h"
|
|
|
|
|
|
|
|
#include <QFile>
|
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QProcess>
|
|
|
|
|
|
|
|
#include "account.h"
|
|
|
|
#include "launchercore.h"
|
2023-08-18 12:59:07 -04:00
|
|
|
#include "profileconfig.h"
|
2023-07-30 08:49:34 -04:00
|
|
|
|
|
|
|
Profile::Profile(LauncherCore &launcher, const QString &key, QObject *parent)
|
|
|
|
: QObject(parent)
|
|
|
|
, m_uuid(key)
|
2023-08-18 12:59:07 -04:00
|
|
|
, m_config(new ProfileConfig(key))
|
2023-07-30 08:49:34 -04:00
|
|
|
, m_launcher(launcher)
|
|
|
|
{
|
|
|
|
readGameVersion();
|
2023-07-31 19:35:53 -04:00
|
|
|
readWineInfo();
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-18 21:36:29 -04:00
|
|
|
const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-18 21:36:29 -04:00
|
|
|
const QDir dalamudDir = dataDir.absoluteFilePath("dalamud");
|
|
|
|
|
|
|
|
if (dalamudDir.exists()) {
|
|
|
|
const QDir dalamudInstallDir = dalamudDir.absoluteFilePath(dalamudChannelName());
|
|
|
|
const QDir dalamudAssetsDir = dalamudDir.absoluteFilePath("assets");
|
|
|
|
const QDir dalamudRuntimeDir = dalamudDir.absoluteFilePath("runtime");
|
|
|
|
|
|
|
|
const QString dalamudDepsJson = dalamudInstallDir.absoluteFilePath("Dalamud.deps.json");
|
|
|
|
if (QFile::exists(dalamudDepsJson)) {
|
|
|
|
QFile depsJson(dalamudDepsJson);
|
2023-07-30 08:49:34 -04:00
|
|
|
depsJson.open(QFile::ReadOnly);
|
|
|
|
QJsonDocument doc = QJsonDocument::fromJson(depsJson.readAll());
|
|
|
|
|
|
|
|
QString versionString;
|
2023-07-30 16:20:28 -04:00
|
|
|
for (auto target : doc["targets"].toObject().keys()) {
|
|
|
|
if (target.contains(".NETCoreApp")) {
|
|
|
|
versionString = doc["targets"].toObject()[target].toObject().keys().filter("Dalamud/")[0];
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
dalamudVersion = versionString.remove("Dalamud/");
|
|
|
|
}
|
|
|
|
|
2023-08-18 21:36:29 -04:00
|
|
|
const QString dalamudAssetsVer = dalamudAssetsDir.absoluteFilePath("asset.ver");
|
|
|
|
if (QFile::exists(dalamudAssetsVer)) {
|
|
|
|
QFile assetJson(dalamudAssetsVer);
|
2023-07-30 08:49:34 -04:00
|
|
|
assetJson.open(QFile::ReadOnly | QFile::Text);
|
|
|
|
|
|
|
|
dalamudAssetVersion = QString(assetJson.readAll()).toInt();
|
|
|
|
}
|
|
|
|
|
2023-08-18 21:36:29 -04:00
|
|
|
const QString dalamudRuntimeVer = dalamudRuntimeDir.absoluteFilePath("runtime.ver");
|
|
|
|
if (QFile::exists(dalamudRuntimeVer)) {
|
|
|
|
QFile runtimeVer(dalamudRuntimeVer);
|
2023-07-30 08:49:34 -04:00
|
|
|
runtimeVer.open(QFile::ReadOnly | QFile::Text);
|
|
|
|
|
|
|
|
runtimeVersion = QString(runtimeVer.readAll());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::readGameData()
|
|
|
|
{
|
|
|
|
physis_EXH *exh = physis_gamedata_read_excel_sheet_header(gameData, "ExVersion");
|
|
|
|
if (exh != nullptr) {
|
|
|
|
physis_EXD exd = physis_gamedata_read_excel_sheet(gameData, "ExVersion", exh, Language::English, 0);
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < exd.row_count; i++) {
|
|
|
|
expansionNames.push_back(exd.row_data[i].column_data[0].string._0);
|
|
|
|
}
|
|
|
|
|
|
|
|
physis_gamedata_free_sheet(exd);
|
|
|
|
physis_gamedata_free_sheet_header(exh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::readWineInfo()
|
|
|
|
{
|
|
|
|
#if defined(Q_OS_MAC)
|
|
|
|
switch (wineType) {
|
|
|
|
case WineType::System: // system wine
|
|
|
|
winePath = "/usr/local/bin/wine64";
|
|
|
|
break;
|
|
|
|
case WineType::Custom: // custom path
|
|
|
|
winePath = profile.winePath;
|
|
|
|
break;
|
|
|
|
case WineType::Builtin: // ffxiv built-in (for mac users)
|
|
|
|
winePath =
|
|
|
|
"/Applications/FINAL FANTASY XIV "
|
|
|
|
"ONLINE.app/Contents/SharedSupport/finalfantasyxiv/FINAL FANTASY XIV ONLINE/wine";
|
|
|
|
break;
|
|
|
|
case WineType::XIVOnMac:
|
|
|
|
winePath = "/Applications/XIV on Mac.app/Contents/Resources/wine/bin/wine64";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Q_OS_LINUX)
|
|
|
|
switch (wineType()) {
|
|
|
|
case WineType::System: // system wine (should be in $PATH)
|
2023-07-31 19:24:23 -04:00
|
|
|
setWinePath("wine");
|
2023-07-30 08:49:34 -04:00
|
|
|
break;
|
|
|
|
case WineType::Custom: // custom pth
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
|
|
|
|
auto wineProcess = new QProcess(this);
|
|
|
|
wineProcess->setProcessChannelMode(QProcess::MergedChannels);
|
|
|
|
|
|
|
|
connect(wineProcess, &QProcess::readyRead, this, [wineProcess, this] {
|
|
|
|
m_wineVersion = wineProcess->readAllStandardOutput().trimmed();
|
|
|
|
Q_EMIT wineVersionText();
|
|
|
|
});
|
|
|
|
|
|
|
|
m_launcher.launchExecutable(*this, wineProcess, {"--version"}, false, false);
|
|
|
|
|
|
|
|
wineProcess->waitForFinished();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::name() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->name();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setName(const QString &name)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->name() != name) {
|
|
|
|
m_config->setName(name);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT nameChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::gamePath() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamePath();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamePath(const QString &path)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamePath() != path) {
|
|
|
|
m_config->setGamePath(path);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamePathChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::winePath() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->winePath();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setWinePath(const QString &path)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->winePath() != path) {
|
|
|
|
m_config->setWinePath(path);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT winePathChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::winePrefixPath() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->winePrefixPath();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setWinePrefixPath(const QString &path)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->winePrefixPath() != path) {
|
|
|
|
m_config->setWinePrefixPath(path);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT winePrefixPathChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::watchdogEnabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->enableWatchdog();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setWatchdogEnabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->enableWatchdog() != value) {
|
|
|
|
m_config->setEnableWatchdog(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT enableWatchdogChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Profile::WineType Profile::wineType() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return static_cast<WineType>(m_config->wineType());
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setWineType(const WineType type)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (static_cast<WineType>(m_config->wineType()) != type) {
|
|
|
|
m_config->setWineType(static_cast<int>(type));
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT wineTypeChanged();
|
2023-07-31 19:35:53 -04:00
|
|
|
readWineInfo();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::esyncEnabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->useESync();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setESyncEnabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->useESync() != value) {
|
|
|
|
m_config->setUseESync(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT useESyncChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::gamescopeEnabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->useGamescope();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeEnabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->useGamescope() != value) {
|
|
|
|
m_config->setUseGamescope(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT useGamescopeChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::gamemodeEnabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->useGamemode();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamemodeEnabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->useGamemode() != value) {
|
|
|
|
m_config->setUseGamemode(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT useGamemodeChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::directx9Enabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->useDX9();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setDirectX9Enabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->useDX9() != value) {
|
|
|
|
m_config->setUseDX9(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT useDX9Changed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::gamescopeFullscreen() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamescopeFullscreen();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeFullscreen(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamescopeFullscreen() != value) {
|
|
|
|
m_config->setGamescopeFullscreen(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamescopeFullscreenChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::gamescopeBorderless() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamescopeBorderless();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeBorderless(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamescopeBorderless() != value) {
|
|
|
|
m_config->setGamescopeBorderless(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamescopeBorderlessChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int Profile::gamescopeWidth() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamescopeWidth();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeWidth(const int value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamescopeWidth() != value) {
|
|
|
|
m_config->setGamescopeWidth(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamescopeWidthChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int Profile::gamescopeHeight() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamescopeHeight();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeHeight(const int value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamescopeHeight() != value) {
|
|
|
|
m_config->setGamescopeHeight(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamescopeHeightChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int Profile::gamescopeRefreshRate() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->gamescopeRefreshRate();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setGamescopeRefreshRate(const int value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->gamescopeRefreshRate() != value) {
|
|
|
|
m_config->setGamescopeRefreshRate(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT gamescopeRefreshRateChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::dalamudEnabled() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->dalamudEnabled();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setDalamudEnabled(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->dalamudEnabled() != value) {
|
|
|
|
m_config->setDalamudEnabled(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT dalamudEnabledChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::dalamudOptOut() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->dalamudOptOut();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setDalamudOptOut(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->dalamudOptOut() != value) {
|
|
|
|
m_config->setDalamudOptOut(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT dalamudOptOutChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Profile::DalamudChannel Profile::dalamudChannel() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return static_cast<DalamudChannel>(m_config->dalamudChannel());
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setDalamudChannel(const DalamudChannel value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (static_cast<DalamudChannel>(m_config->dalamudChannel()) != value) {
|
|
|
|
m_config->setDalamudChannel(static_cast<int>(value));
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT dalamudChannelChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Profile::argumentsEncrypted() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->encryptArguments();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setArgumentsEncrypted(const bool value)
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
if (m_config->encryptArguments() != value) {
|
|
|
|
m_config->setEncryptArguments(value);
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
Q_EMIT encryptedArgumentsChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Account *Profile::account() const
|
|
|
|
{
|
|
|
|
return m_account;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::setAccount(Account *account)
|
|
|
|
{
|
|
|
|
if (account != m_account) {
|
|
|
|
m_account = account;
|
2023-08-18 12:59:07 -04:00
|
|
|
if (account->uuid() != m_config->account()) {
|
|
|
|
m_config->setAccount(account->uuid());
|
|
|
|
m_config->save();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
Q_EMIT accountChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Profile::readGameVersion()
|
|
|
|
{
|
|
|
|
if (gamePath().isEmpty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gameData = physis_gamedata_initialize((gamePath() + "/game").toStdString().c_str());
|
|
|
|
bootData = physis_bootdata_initialize((gamePath() + "/boot").toStdString().c_str());
|
|
|
|
|
|
|
|
if (bootData != nullptr) {
|
|
|
|
bootVersion = physis_bootdata_get_version(bootData);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gameData != nullptr) {
|
|
|
|
repositories = physis_gamedata_get_repositories(gameData);
|
|
|
|
readGameData();
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_EMIT gameInstallChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::accountUuid() const
|
|
|
|
{
|
2023-08-18 12:59:07 -04:00
|
|
|
return m_config->account();
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::expansionVersionText() const
|
|
|
|
{
|
|
|
|
if (!isGameInstalled()) {
|
|
|
|
return "No game installed.";
|
|
|
|
} else {
|
|
|
|
QString expacString;
|
|
|
|
|
|
|
|
expacString += "Boot";
|
|
|
|
expacString += QString(" (%1)").arg(bootVersion);
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < repositories.repositories_count; i++) {
|
|
|
|
QString expansionName = "Unknown Expansion";
|
|
|
|
if (i < static_cast<unsigned int>(expansionNames.size())) {
|
|
|
|
expansionName = expansionNames[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
expacString += QString("\n%1 (%2)").arg(expansionName, repositories.repositories[i].version);
|
|
|
|
}
|
|
|
|
|
|
|
|
return expacString;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::dalamudVersionText() const
|
|
|
|
{
|
|
|
|
QString text;
|
|
|
|
if (dalamudVersion.isEmpty()) {
|
|
|
|
text += "Dalamud is not installed.";
|
|
|
|
} else {
|
2023-07-31 18:57:21 -04:00
|
|
|
text += QStringLiteral("Dalamud (%1)").arg(dalamudVersion);
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dalamudAssetVersion != -1) {
|
2023-07-31 18:57:21 -04:00
|
|
|
text += QStringLiteral("\nAssets (%1)").arg(QString::number(dalamudAssetVersion));
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::uuid() const
|
|
|
|
{
|
|
|
|
return m_uuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Profile::wineVersionText() const
|
|
|
|
{
|
|
|
|
if (m_launcher.isSteam()) {
|
|
|
|
return "Wine is being managed by Steam.";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isWineInstalled()) {
|
|
|
|
return "Wine is not installed.";
|
|
|
|
} else {
|
|
|
|
return m_wineVersion;
|
|
|
|
}
|
|
|
|
}
|
2023-08-18 14:52:06 -04:00
|
|
|
|
|
|
|
QString Profile::dalamudChannelName() const
|
|
|
|
{
|
|
|
|
switch (dalamudChannel()) {
|
|
|
|
case DalamudChannel::Stable:
|
|
|
|
return QStringLiteral("stable");
|
|
|
|
case DalamudChannel::Staging:
|
|
|
|
return QStringLiteral("staging");
|
|
|
|
case DalamudChannel::Net5:
|
|
|
|
return QStringLiteral("net5");
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_UNREACHABLE();
|
|
|
|
}
|