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

Don't store patches in temp directories anymore

This was causing memory issues on systems (like Linux/Flatpak) where the
temp directory existed on tmpfs (aka RAM). Now they're stored in app
data and deleted when we're finished with them.

Fixes #17
This commit is contained in:
Joshua Goins 2024-06-29 11:00:48 -04:00
parent 99b7255c66
commit 99785e5d68

View file

@ -233,16 +233,16 @@ void Patcher::processPatch(const QueuedPatch &patch)
} }
Utility::writeVersion(verFilePath, patch.version); Utility::writeVersion(verFilePath, patch.version);
if (!m_launcher.settings()->keepPatches()) {
QFile::remove(patch.path);
}
} }
void Patcher::setupDirectories() void Patcher::setupDirectories()
{ {
QDir dataDir; QDir dataDir;
if (m_launcher.settings()->keepPatches()) { dataDir.setPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
dataDir.setPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
} else {
dataDir.setPath(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
}
m_patchesDir.setPath(dataDir.absoluteFilePath(QStringLiteral("patch"))); m_patchesDir.setPath(dataDir.absoluteFilePath(QStringLiteral("patch")));
} }