mirror of https://github.com/procxx/kepka.git
testing beta update to 9014002, frequent beta update check, no creating .desktop file for beta
This commit is contained in:
parent
8552b8421b
commit
c8c13219ed
|
@ -174,7 +174,7 @@ int main(int argc, char *argv[])
|
||||||
} else if (string("-dev") == argv[i]) {
|
} else if (string("-dev") == argv[i]) {
|
||||||
DevChannel = true;
|
DevChannel = true;
|
||||||
} else if (string("-beta") == argv[i] && i + 1 < argc) {
|
} else if (string("-beta") == argv[i] && i + 1 < argc) {
|
||||||
BetaVersion = QString(argv[i + 1]).toLongLong();
|
BetaVersion = QString(argv[i + 1]).toULongLong();
|
||||||
if (BetaVersion > version * 1000ULL && BetaVersion < (version + 1) * 1000ULL) {
|
if (BetaVersion > version * 1000ULL && BetaVersion < (version + 1) * 1000ULL) {
|
||||||
DevChannel = false;
|
DevChannel = false;
|
||||||
BetaSignature = countBetaVersionSignature(BetaVersion);
|
BetaSignature = countBetaVersionSignature(BetaVersion);
|
||||||
|
|
|
@ -210,14 +210,14 @@ void Application::updateGotCurrent() {
|
||||||
cSetLastUpdateCheck(unixtime());
|
cSetLastUpdateCheck(unixtime());
|
||||||
QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromUtf8(updateReply->readAll()));
|
QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromUtf8(updateReply->readAll()));
|
||||||
if (m.hasMatch()) {
|
if (m.hasMatch()) {
|
||||||
int32 currentVersion = m.captured(1).toInt();
|
uint64 currentVersion = m.captured(1).toULongLong();
|
||||||
QString url = m.captured(2);
|
QString url = m.captured(2);
|
||||||
bool betaVersion = false;
|
bool betaVersion = false;
|
||||||
if (url.startsWith(qstr("beta_"))) {
|
if (url.startsWith(qstr("beta_"))) {
|
||||||
betaVersion = true;
|
betaVersion = true;
|
||||||
url = url.mid(5) + '_' + countBetaVersionSignature(currentVersion);
|
url = url.mid(5) + '_' + countBetaVersionSignature(currentVersion);
|
||||||
}
|
}
|
||||||
if ((!betaVersion || cBetaVersion()) && currentVersion > (betaVersion ? cBetaVersion() : AppVersion)) {
|
if ((!betaVersion || cBetaVersion()) && currentVersion > (betaVersion ? cBetaVersion() : uint64(AppVersion))) {
|
||||||
updateThread = new QThread();
|
updateThread = new QThread();
|
||||||
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
|
connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater()));
|
||||||
updateDownloader = new UpdateDownloader(updateThread, url);
|
updateDownloader = new UpdateDownloader(updateThread, url);
|
||||||
|
@ -549,8 +549,9 @@ void Application::startUpdateCheck(bool forceWait) {
|
||||||
updateCheckTimer.stop();
|
updateCheckTimer.stop();
|
||||||
if (updateRequestId || updateThread || updateReply || !cAutoUpdate()) return;
|
if (updateRequestId || updateThread || updateReply || !cAutoUpdate()) return;
|
||||||
|
|
||||||
int32 updateInSecs = cLastUpdateCheck() + UpdateDelayConstPart + (rand() % UpdateDelayRandPart) - unixtime();
|
int32 constDelay = cBetaVersion() ? 600 : UpdateDelayConstPart, randDelay = cBetaVersion() ? 300 : UpdateDelayRandPart;
|
||||||
bool sendRequest = (updateInSecs <= 0 || updateInSecs > (UpdateDelayConstPart + UpdateDelayRandPart));
|
int32 updateInSecs = cLastUpdateCheck() + constDelay + (rand() % randDelay) - unixtime();
|
||||||
|
bool sendRequest = (updateInSecs <= 0 || updateInSecs > (constDelay + randDelay));
|
||||||
if (!sendRequest && !forceWait) {
|
if (!sendRequest && !forceWait) {
|
||||||
QDir updates(cWorkingDir() + "tupdates");
|
QDir updates(cWorkingDir() + "tupdates");
|
||||||
if (updates.exists()) {
|
if (updates.exists()) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
||||||
static const int32 AppVersion = 9014;
|
static const int32 AppVersion = 9014;
|
||||||
static const wchar_t *AppVersionStr = L"0.9.14";
|
static const wchar_t *AppVersionStr = L"0.9.14";
|
||||||
static const bool DevVersion = true;
|
static const bool DevVersion = true;
|
||||||
#define BETA_VERSION (9014001ULL) // just comment this line to build public version
|
#define BETA_VERSION (9014002ULL) // just comment this line to build public version
|
||||||
|
|
||||||
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
||||||
static const wchar_t *AppName = L"Telegram Desktop";
|
static const wchar_t *AppName = L"Telegram Desktop";
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ namespace {
|
||||||
void psRegisterCustomScheme() {
|
void psRegisterCustomScheme() {
|
||||||
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||||
QString home(_psHomeDir());
|
QString home(_psHomeDir());
|
||||||
if (home.isEmpty()) return;
|
if (home.isEmpty() || cBetaVersion()) return; // don't update desktop file for beta version
|
||||||
|
|
||||||
DEBUG_LOG(("App Info: placing .desktop file"));
|
DEBUG_LOG(("App Info: placing .desktop file"));
|
||||||
if (QDir(home + qsl(".local/")).exists()) {
|
if (QDir(home + qsl(".local/")).exists()) {
|
||||||
|
|
|
@ -3,4 +3,4 @@ AppVersionStrMajor 0.9
|
||||||
AppVersionStrSmall 0.9.14
|
AppVersionStrSmall 0.9.14
|
||||||
AppVersionStr 0.9.14
|
AppVersionStr 0.9.14
|
||||||
DevChannel 1
|
DevChannel 1
|
||||||
BetaVersion 9014001
|
BetaVersion 9014002
|
||||||
|
|
Loading…
Reference in New Issue