mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add '-externalupdater' command-line argument.
Now no-autoupdater mode can be switched on in runtime. Also TDESKTOP_DISABLE_AUTOUPDATE build is disabled in CI (trivial). Fixes #4895.
This commit is contained in:
@@ -84,20 +84,20 @@ Widget::Widget(QWidget *parent) : RpWidget(parent)
|
||||
|
||||
cSetPasswordRecovered(false);
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
Core::UpdateChecker checker;
|
||||
checker.isLatest() | rpl::start_with_next([=] {
|
||||
if (!Core::UpdaterDisabled()) {
|
||||
Core::UpdateChecker checker;
|
||||
checker.isLatest() | rpl::start_with_next([=] {
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.failed() | rpl::start_with_next([=] {
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.ready() | rpl::start_with_next([=] {
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.start();
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.failed() | rpl::start_with_next([=] {
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.ready() | rpl::start_with_next([=] {
|
||||
onCheckUpdateStatus();
|
||||
}, lifetime());
|
||||
checker.start();
|
||||
onCheckUpdateStatus();
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::setupConnectingWidget() {
|
||||
@@ -148,8 +148,9 @@ void Widget::createLanguageLink() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
void Widget::onCheckUpdateStatus() {
|
||||
Expects(!Core::UpdaterDisabled());
|
||||
|
||||
if (Core::UpdateChecker().state() == Core::UpdateChecker::State::Ready) {
|
||||
if (_update) return;
|
||||
_update.create(
|
||||
@@ -173,7 +174,6 @@ void Widget::onCheckUpdateStatus() {
|
||||
}
|
||||
updateControlsGeometry();
|
||||
}
|
||||
#endif // TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void Widget::setInnerFocus() {
|
||||
if (getStep()->animating()) {
|
||||
|
@@ -48,10 +48,8 @@ protected:
|
||||
signals:
|
||||
void countryChanged();
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
private slots:
|
||||
void onCheckUpdateStatus();
|
||||
#endif // TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
// Internal interface.
|
||||
public:
|
||||
|
Reference in New Issue
Block a user