1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00

Use a better default wine prefix path

This manages prefixes by default, like we do with game installs and user
documents now. It's still possible to point to an existing wine prefix.
This commit is contained in:
Joshua Goins 2023-10-08 18:15:41 -04:00
parent c05311fccc
commit 7280aa5a48
4 changed files with 13 additions and 0 deletions

View file

@ -41,6 +41,7 @@ public:
Q_INVOKABLE bool canDelete(Profile *account) const;
static QString getDefaultGamePath(const QString &uuid);
static QString getDefaultWinePrefixPath(const QString &uuid);
private:
void insertProfile(Profile *profile);

View file

@ -22,6 +22,7 @@ SPDX-License-Identifier: CC0-1.0
<entry key="WinePath" type="Path">
</entry>
<entry key="WinePrefixPath" type="Path">
<default code="true">ProfileManager::getDefaultWinePrefixPath(mParamuuid)</default>
</entry>
<entry key="WineType" type="Enum">
<choices>

View file

@ -218,6 +218,10 @@ QString LauncherCore::getGameArgs(const Profile &profile, const LoginAuth &auth)
QDir().mkpath(profile.account()->getConfigDir().absolutePath());
}
if (!QDir().exists(profile.winePrefixPath())) {
QDir().mkpath(profile.winePrefixPath());
}
if (!auth.lobbyhost.isEmpty()) {
gameArgs.push_back({QStringLiteral("DEV.GMServerHost"), auth.frontierHost});
for (int i = 1; i < 9; i++) {

View file

@ -97,6 +97,13 @@ QString ProfileManager::getDefaultGamePath(const QString &uuid)
#endif
}
QString ProfileManager::getDefaultWinePrefixPath(const QString &uuid)
{
const QDir appData = QStandardPaths::standardLocations(QStandardPaths::StandardLocation::AppDataLocation)[0];
const QDir prefixDir = appData.absoluteFilePath(QStringLiteral("prefix"));
return prefixDir.absoluteFilePath(uuid);
}
void ProfileManager::load()
{
auto config = KSharedConfig::openStateConfig();