2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Make alpha branches test

This commit is contained in:
RadRussianRus
2021-04-14 20:27:23 +03:00
parent f352b5bc58
commit d3264a18fa
10 changed files with 32 additions and 12 deletions

View File

@@ -105,6 +105,7 @@ void AboutBox::resizeEvent(QResizeEvent *e) {
}
void AboutBox::showVersionHistory() {
/*
if (cRealAlphaVersion()) {
auto url = qsl("https://tdesktop.com/");
if (Platform::IsWindows32Bit()) {
@@ -128,8 +129,11 @@ void AboutBox::showVersionHistory() {
Ui::show(Box<InformBox>("The link to the current private alpha version of Telegram Desktop was copied to the clipboard."));
} else {
*/
UrlClickHandler::Open(Core::App().changelogLink());
/*
}
*/
}
void AboutBox::keyPressEvent(QKeyEvent *e) {
@@ -160,7 +164,7 @@ QString telegramFaqLink() {
QString currentVersionText() {
auto result = QString::fromLatin1(AppKotatoVersionStr);
if (cAlphaVersion()) {
result += qsl(" alpha %1").arg(cAlphaVersion() % 1000);
result += qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000);
} else if (AppBetaVersion) {
result += " beta";
}

View File

@@ -31,7 +31,7 @@ object_ptr<ConfirmPhoneBox> CurrentConfirmPhoneBox = { nullptr };
void SendToBannedHelp(const QString &phone) {
const auto version = QString::fromLatin1(AppVersionStr)
+ (cAlphaVersion()
? qsl(" alpha %1").arg(cAlphaVersion())
? qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000)
: (AppBetaVersion ? " beta" : ""));
const auto subject = qsl("Banned phone number: ") + phone;

View File

@@ -439,7 +439,7 @@ QString LastCrashedWindow::getReportField(const QLatin1String &name, const QLati
QString data = lines.at(i).trimmed().mid(prefix.size()).trimmed();
if (name == qstr("version")) {
if (data.endsWith(qstr(" alpha"))) {
if (data.endsWith(qstr(" %1").arg(AppKotatoTestBranch))) {
data = QString::number(-data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong());
} else {
data = QString::number(data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong());

View File

@@ -346,7 +346,7 @@ void StartCatching(not_null<Core::Launcher*> launcher) {
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
ProcessAnnotations["Binary"] = cExeName().toUtf8().constData();
ProcessAnnotations["ApiId"] = QString::number(cApiId()).toUtf8().constData();
ProcessAnnotations["Version"] = (cAlphaVersion() ? qsl("%1 alpha").arg(cAlphaVersion()) : (AppBetaVersion ? qsl("%1 beta") : qsl("%1")).arg(AppKotatoVersion)).toUtf8().constData();
ProcessAnnotations["Version"] = (cAlphaVersion() ? qsl("%1 %2").arg(cAlphaVersion()).arg(AppKotatoTestBranch) : (AppBetaVersion ? qsl("%1 beta") : qsl("%1")).arg(AppKotatoVersion)).toUtf8().constData();
ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().constData();
ProcessAnnotations["Platform"] = PlatformString().toUtf8().constData();
ProcessAnnotations["UserTag"] = QString::number(launcher->installationTag(), 16).toUtf8().constData();

View File

@@ -518,7 +518,7 @@ bool ParseCommonMap(
const auto types = (*it).toObject();
const auto list = [&]() -> std::vector<QString> {
if (cAlphaVersion()) {
return { "alpha", "beta", "stable" };
return { AppKotatoTestBranch };
} else if (cInstallBetaVersion()) {
return { "beta", "stable" };
}
@@ -541,7 +541,7 @@ bool ParseCommonMap(
if (version == map.constEnd()) {
continue;
}
const auto isAvailableAlpha = (type == "alpha");
const auto isAvailableAlpha = (type == AppKotatoTestBranch);
const auto availableVersion = [&] {
if ((*version).isString()) {
const auto string = (*version).toString();
@@ -1493,7 +1493,7 @@ bool checkReadyUpdate() {
return false;
}
if (!cAlphaVersion() || alphaVersion <= cAlphaVersion()) {
LOG(("Update Error: cant install alpha version %1 having alpha version %2").arg(alphaVersion).arg(cAlphaVersion()));
LOG(("Update Error: cant install alpha version %1 having %2 version %3").arg(alphaVersion).arg(AppKotatoTestBranch).arg(cAlphaVersion()));
ClearAll();
return false;
}

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
//#include "base/const_string.h"
#include "kotato/version.h"
/*
#define TDESKTOP_REQUESTED_ALPHA_VERSION (0ULL)
#ifdef TDESKTOP_ALLOW_CLOSED_ALPHA
@@ -18,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#else // TDESKTOP_ALLOW_CLOSED_ALPHA
#define TDESKTOP_ALPHA_VERSION (0ULL)
#endif // TDESKTOP_ALLOW_CLOSED_ALPHA
*/
// used in Updater.cpp and Setup.iss for Windows
//constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;

View File

@@ -15,3 +15,14 @@ constexpr auto AppFile = "Kotatogram"_cs;
constexpr auto AppKotatoVersion = 1004000;
constexpr auto AppKotatoVersionStr = "1.4";
constexpr auto AppBetaVersion = false;
// Test branch related
constexpr auto AppKotatoTestBranch = "dev";
#define TDESKTOP_REQUESTED_ALPHA_VERSION (0ULL)
#ifdef TDESKTOP_ALLOW_CLOSED_ALPHA
#define TDESKTOP_ALPHA_VERSION TDESKTOP_REQUESTED_ALPHA_VERSION
#else // TDESKTOP_ALLOW_CLOSED_ALPHA
#define TDESKTOP_ALPHA_VERSION (0ULL)
#endif // TDESKTOP_ALLOW_CLOSED_ALPHA

View File

@@ -414,9 +414,10 @@ void start(not_null<Core::Launcher*> launcher) {
LogsData = nullptr;
}
LOG(("Launched version: %1, install beta: %2, alpha: %3, debug mode: %4"
LOG(("Launched version: %1, install beta: %2, %3: %4, debug mode: %5"
).arg(AppVersion
).arg(Logs::b(cInstallBetaVersion())
).arg(AppKotatoTestBranch
).arg(cAlphaVersion()
).arg(Logs::b(DebugEnabled())));
LOG(("Executable dir: %1, name: %2").arg(cExeDir(), cExeName()));

View File

@@ -98,7 +98,9 @@ using namespace details;
#else // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC)
return Platform::IsWindows64Bit() ? u" x64"_q : QString();
#endif // OS_MAC_STORE || OS_WIN_STORE || (defined Q_OS_UNIX && !defined Q_OS_MAC)
})() + qsl(" (TD %1)").arg(AppVersionStr);
})() + (cAlphaVersion()
? (qsl("-%1.%2").arg(AppKotatoTestBranch).arg(cAlphaVersion() % 1000))
: QString());
}
void WrapInvokeAfter(

View File

@@ -25,9 +25,9 @@ if (DESKTOP_APP_DISABLE_AUTOUPDATE)
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE)
endif()
# if (DESKTOP_APP_SPECIAL_TARGET)
# target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
# endif()
if (DESKTOP_APP_SPECIAL_TARGET)
target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
endif()
if (NOT TDESKTOP_LAUNCHER_BASENAME)
set(TDESKTOP_LAUNCHER_BASENAME "kotatogramdesktop")