2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support toggling installs of beta versions.

This commit is contained in:
John Preston
2018-09-26 18:11:16 +03:00
parent 6e566e0165
commit 971d0efda9
10 changed files with 32 additions and 18 deletions

View File

@@ -447,14 +447,18 @@ void WorkingDirReady() {
&& QFile(cWorkingDir() + qsl("tdata/withdebug")).exists()) {
Logs::SetDebugEnabled(true);
}
const auto installBetaPath = cWorkingDir() + qsl("tdata/devversion");
if (cAlphaVersion()) {
cSetBetaVersion(false);
} else if (!cBetaVersion() && QFile(cWorkingDir() + qsl("tdata/devversion")).exists()) {
cSetBetaVersion(true);
cSetInstallBetaVersion(false);
} else if (QFile(installBetaPath).exists()) {
QFile f(installBetaPath);
if (f.open(QIODevice::ReadOnly)) {
cSetInstallBetaVersion(f.read(1) != "0");
}
} else if (AppBetaVersion) {
QFile f(cWorkingDir() + qsl("tdata/devversion"));
if (!f.exists() && f.open(QIODevice::WriteOnly)) {
f.write("1");
QFile f(installBetaPath);
if (f.open(QIODevice::WriteOnly)) {
f.write(cInstallBetaVersion() ? "1" : "0");
}
}