builds fixes

This commit is contained in:
2026-08-27 16:44:42 +03:00
parent 168884127b
commit 08e0dc4965
10 changed files with 788 additions and 360 deletions
+22
View File
@@ -352,6 +352,28 @@ void BuildSwitcher::fail(const QString &message, bool gameDirIntact)
emit failed(toId, message, gameDirIntact);
}
// ── Удаление сборки ────────────────────────────────────────────────────────
bool BuildSwitcher::forgetBuild(int buildId)
{
if (buildId < 0)
return true;
// Запись убираем в любом случае: даже если файл не удалось стереть, ссылаться
// на архив несуществующей сборки нельзя — иначе он «воскреснет» под новой
// сборкой с тем же id.
QJsonObject index = readIndex();
QJsonObject builds = index.value(QStringLiteral("builds")).toObject();
builds.remove(QString::number(buildId));
index.insert(QStringLiteral("builds"), builds);
if (index.value(QStringLiteral("active")).toInt(-1) == buildId)
index.remove(QStringLiteral("active"));
writeIndex(index);
QDir dir(buildDir(buildId));
return !dir.exists() || dir.removeRecursively();
}
// ── Незавершённое переключение ─────────────────────────────────────────────
QString BuildSwitcher::interruptedSwitchWarning() const