mirror of https://github.com/procxx/kepka.git
Use base::call_delayed.
This commit is contained in:
parent
09a7daf164
commit
30a1bd7ba2
|
@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "base/openssl_help.h"
|
#include "base/openssl_help.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "observer_peer.h"
|
#include "observer_peer.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -361,7 +362,7 @@ void ApiWrap::requestTermsUpdate() {
|
||||||
}
|
}
|
||||||
const auto now = crl::now();
|
const auto now = crl::now();
|
||||||
if (_termsUpdateSendAt && now < _termsUpdateSendAt) {
|
if (_termsUpdateSendAt && now < _termsUpdateSendAt) {
|
||||||
App::CallDelayed(_termsUpdateSendAt - now, _session, [=] {
|
base::call_delayed(_termsUpdateSendAt - now, _session, [=] {
|
||||||
requestTermsUpdate();
|
requestTermsUpdate();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -1283,7 +1284,7 @@ void ApiWrap::gotUserFull(
|
||||||
const auto &d = result.c_userFull();
|
const auto &d = result.c_userFull();
|
||||||
if (user == _session->user() && !_session->validateSelf(d.vuser())) {
|
if (user == _session->user() && !_session->validateSelf(d.vuser())) {
|
||||||
constexpr auto kRequestUserAgainTimeout = crl::time(10000);
|
constexpr auto kRequestUserAgainTimeout = crl::time(10000);
|
||||||
App::CallDelayed(kRequestUserAgainTimeout, _session, [=] {
|
base::call_delayed(kRequestUserAgainTimeout, _session, [=] {
|
||||||
requestFullPeer(user);
|
requestFullPeer(user);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -780,8 +780,8 @@ themesMenuToggle: IconButton(defaultIconButton) {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
|
|
||||||
icon: icon {{ "title_menu_dots", menuIconFg }};
|
icon: menuToggleIcon;
|
||||||
iconOver: icon {{ "title_menu_dots", menuIconFgOver }};
|
iconOver: menuToggleIconOver;
|
||||||
iconPosition: point(-1px, -1px);
|
iconPosition: point(-1px, -1px);
|
||||||
|
|
||||||
rippleAreaPosition: point(4px, 4px);
|
rippleAreaPosition: point(4px, 4px);
|
||||||
|
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "base/qthelp_url.h"
|
#include "base/qthelp_url.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "main/main_account.h"
|
#include "main/main_account.h"
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
|
@ -1437,7 +1438,7 @@ void ProxiesBoxController::share(const ProxyData &proxy) {
|
||||||
|
|
||||||
ProxiesBoxController::~ProxiesBoxController() {
|
ProxiesBoxController::~ProxiesBoxController() {
|
||||||
if (_saveTimer.isActive()) {
|
if (_saveTimer.isActive()) {
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
kSaveSettingsDelayedTimeout,
|
kSaveSettingsDelayedTimeout,
|
||||||
QCoreApplication::instance(),
|
QCoreApplication::instance(),
|
||||||
[] { Local::writeSettings(); });
|
[] { Local::writeSettings(); });
|
||||||
|
|
|
@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "base/unique_qptr.h"
|
#include "base/unique_qptr.h"
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
#include "facades.h"
|
#include "base/call_delayed.h"
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
@ -400,7 +400,7 @@ void Options::Option::destroy(FnMut<void()> done) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_field->hide(anim::type::normal);
|
_field->hide(anim::type::normal);
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
st::slideWrapDuration * 2,
|
st::slideWrapDuration * 2,
|
||||||
_field.get(),
|
_field.get(),
|
||||||
std::move(done));
|
std::move(done));
|
||||||
|
|
|
@ -16,9 +16,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_file_origin.h"
|
#include "data/data_file_origin.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_document.h"
|
#include "data/data_document.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "facades.h"
|
|
||||||
#include "styles/style_history.h"
|
#include "styles/style_history.h"
|
||||||
|
|
||||||
#include <QtCore/QBuffer>
|
#include <QtCore/QBuffer>
|
||||||
|
@ -601,7 +601,7 @@ base::flat_map<uint64, not_null<DocumentData*>> EmojiPack::collectStickers(
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiPack::refreshDelayed() {
|
void EmojiPack::refreshDelayed() {
|
||||||
App::CallDelayed(details::kRefreshTimeout, _session, [=] {
|
base::call_delayed(details::kRefreshTimeout, _session, [=] {
|
||||||
refresh();
|
refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,10 +220,6 @@ public:
|
||||||
void call_handleDelayedPeerUpdates();
|
void call_handleDelayedPeerUpdates();
|
||||||
void call_handleObservables();
|
void call_handleObservables();
|
||||||
|
|
||||||
void callDelayed(int duration, FnMut<void()> &&lambda) {
|
|
||||||
_callDelayedTimer.call(duration, std::move(lambda));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *object, QEvent *event) override;
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
|
|
||||||
|
@ -283,7 +279,6 @@ private:
|
||||||
rpl::event_stream<bool> _termsLockChanges;
|
rpl::event_stream<bool> _termsLockChanges;
|
||||||
std::unique_ptr<Window::TermsLock> _termsLock;
|
std::unique_ptr<Window::TermsLock> _termsLock;
|
||||||
|
|
||||||
base::DelayedCallTimer _callDelayedTimer;
|
|
||||||
base::Timer _saveSettingsTimer;
|
base::Timer _saveSettingsTimer;
|
||||||
|
|
||||||
struct LeaveSubscription {
|
struct LeaveSubscription {
|
||||||
|
|
|
@ -49,6 +49,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_cloud_themes.h"
|
#include "data/data_cloud_themes.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "styles/style_boxes.h" // st::backgroundSize
|
#include "styles/style_boxes.h" // st::backgroundSize
|
||||||
|
@ -933,7 +934,7 @@ void Session::suggestStartExport() {
|
||||||
? 0
|
? 0
|
||||||
: (_exportAvailableAt - now);
|
: (_exportAvailableAt - now);
|
||||||
if (left) {
|
if (left) {
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
std::min(left + 5, 3600) * crl::time(1000),
|
std::min(left + 5, 3600) * crl::time(1000),
|
||||||
_session,
|
_session,
|
||||||
[=] { suggestStartExport(); });
|
[=] { suggestStartExport(); });
|
||||||
|
@ -991,7 +992,7 @@ void Session::rememberPassportCredentials(
|
||||||
_passportCredentials = std::make_unique<CredentialsWithGeneration>(
|
_passportCredentials = std::make_unique<CredentialsWithGeneration>(
|
||||||
std::move(data),
|
std::move(data),
|
||||||
++generation);
|
++generation);
|
||||||
App::CallDelayed(rememberFor, _session, [=, check = generation] {
|
base::call_delayed(rememberFor, _session, [=, check = generation] {
|
||||||
if (_passportCredentials && _passportCredentials->second == check) {
|
if (_passportCredentials && _passportCredentials->second == check) {
|
||||||
forgetPassportCredentials();
|
forgetPassportCredentials();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,13 +33,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
|
|
||||||
namespace App {
|
namespace App {
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
void CallDelayed(int duration, FnMut<void()> &&lambda) {
|
|
||||||
Core::App().callDelayed(duration, std::move(lambda));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) {
|
void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) {
|
||||||
if (auto m = App::main()) {
|
if (auto m = App::main()) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "base/type_traits.h"
|
#include "base/type_traits.h"
|
||||||
#include "base/observer.h"
|
#include "base/observer.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "ui/effects/animation_value.h"
|
#include "ui/effects/animation_value.h"
|
||||||
|
|
||||||
class History;
|
class History;
|
||||||
|
@ -28,27 +29,6 @@ class ItemBase;
|
||||||
} // namespace InlineBots
|
} // namespace InlineBots
|
||||||
|
|
||||||
namespace App {
|
namespace App {
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
void CallDelayed(int duration, FnMut<void()> &&lambda);
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
template <typename Guard, typename Lambda>
|
|
||||||
inline void CallDelayed(
|
|
||||||
int duration,
|
|
||||||
crl::guarded_wrap<Guard, Lambda> &&guarded) {
|
|
||||||
return internal::CallDelayed(
|
|
||||||
duration,
|
|
||||||
std::move(guarded));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Guard, typename Lambda>
|
|
||||||
inline void CallDelayed(int duration, Guard &&object, Lambda &&lambda) {
|
|
||||||
return internal::CallDelayed(duration, crl::guard(
|
|
||||||
std::forward<Guard>(object),
|
|
||||||
std::forward<Lambda>(lambda)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Guard, typename Lambda>
|
template <typename Guard, typename Lambda>
|
||||||
[[nodiscard]] inline auto LambdaDelayed(int duration, Guard &&object, Lambda &&lambda) {
|
[[nodiscard]] inline auto LambdaDelayed(int duration, Guard &&object, Lambda &&lambda) {
|
||||||
|
@ -57,7 +37,7 @@ template <typename Guard, typename Lambda>
|
||||||
std::forward<Lambda>(lambda));
|
std::forward<Lambda>(lambda));
|
||||||
return [saved = std::move(guarded), duration] {
|
return [saved = std::move(guarded), duration] {
|
||||||
auto copy = saved;
|
auto copy = saved;
|
||||||
internal::CallDelayed(duration, std::move(copy));
|
base::call_delayed(duration, std::move(copy));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "inline_bots/inline_bot_result.h"
|
#include "inline_bots/inline_bot_result.h"
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "data/data_drafts.h"
|
#include "data/data_drafts.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_web_page.h"
|
#include "data/data_web_page.h"
|
||||||
|
@ -3755,7 +3756,7 @@ void HistoryWidget::updateSendButtonType() {
|
||||||
&& (type == Type::Send || type == Type::Record));
|
&& (type == Type::Send || type == Type::Record));
|
||||||
|
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
kRefreshSlowmodeLabelTimeout,
|
kRefreshSlowmodeLabelTimeout,
|
||||||
this,
|
this,
|
||||||
[=] { updateSendButtonType(); });
|
[=] { updateSendButtonType(); });
|
||||||
|
|
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "base/qt_signal_producer.h"
|
#include "base/qt_signal_producer.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "chat_helpers/tabbed_panel.h"
|
#include "chat_helpers/tabbed_panel.h"
|
||||||
|
@ -281,7 +282,7 @@ void ComposeControls::updateSendButtonType() {
|
||||||
// && (type == Type::Send || type == Type::Record));
|
// && (type == Type::Send || type == Type::Record));
|
||||||
|
|
||||||
//if (delay != 0) {
|
//if (delay != 0) {
|
||||||
// App::CallDelayed(
|
// base::call_delayed(
|
||||||
// kRefreshSlowmodeLabelTimeout,
|
// kRefreshSlowmodeLabelTimeout,
|
||||||
// this,
|
// this,
|
||||||
// [=] { updateSendButtonType(); });
|
// [=] { updateSendButtonType(); });
|
||||||
|
|
|
@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "window/window_peer_menu.h"
|
#include "window/window_peer_menu.h"
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
|
@ -143,7 +144,7 @@ void ScheduledWidget::setupComposeControls() {
|
||||||
return !_choosingAttach;
|
return !_choosingAttach;
|
||||||
}) | rpl::start_with_next([=] {
|
}) | rpl::start_with_next([=] {
|
||||||
_choosingAttach = true;
|
_choosingAttach = true;
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
st::historyAttach.ripple.hideDuration,
|
st::historyAttach.ripple.hideDuration,
|
||||||
this,
|
this,
|
||||||
[=] { _choosingAttach = false; chooseAttach(); });
|
[=] { _choosingAttach = false; chooseAttach(); });
|
||||||
|
|
|
@ -753,8 +753,8 @@ topBarCallSkip: -1px;
|
||||||
topBarMenuToggle: IconButton(topBarSearch) {
|
topBarMenuToggle: IconButton(topBarSearch) {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
|
|
||||||
icon: icon {{ "title_menu_dots", menuIconFg }};
|
icon: menuToggleIcon;
|
||||||
iconOver: icon {{ "title_menu_dots", menuIconFgOver }};
|
iconOver: menuToggleIconOver;
|
||||||
iconPosition: point(16px, 17px);
|
iconPosition: point(16px, 17px);
|
||||||
|
|
||||||
rippleAreaPosition: point(0px, 7px);
|
rippleAreaPosition: point(0px, 7px);
|
||||||
|
|
|
@ -150,8 +150,8 @@ introBackButton: IconButton(defaultIconButton) {
|
||||||
width: 56px;
|
width: 56px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
|
|
||||||
icon: icon {{ "box_button_back", menuIconFg }};
|
icon: backButtonIcon;
|
||||||
iconOver: icon {{ "box_button_back", menuIconFgOver }};
|
iconOver: backButtonIconOver;
|
||||||
|
|
||||||
rippleAreaPosition: point(8px, 8px);
|
rippleAreaPosition: point(8px, 8px);
|
||||||
rippleAreaSize: 40px;
|
rippleAreaSize: 40px;
|
||||||
|
|
|
@ -8,8 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "main/main_app_config.h"
|
#include "main/main_app_config.h"
|
||||||
|
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "facades.h"
|
|
||||||
|
|
||||||
namespace Main {
|
namespace Main {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -44,7 +44,7 @@ void AppConfig::refresh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppConfig::refreshDelayed() {
|
void AppConfig::refreshDelayed() {
|
||||||
App::CallDelayed(kRefreshTimeout, _session, [=] {
|
base::call_delayed(kRefreshTimeout, _session, [=] {
|
||||||
refresh();
|
refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "settings/settings_intro.h"
|
#include "settings/settings_intro.h"
|
||||||
#include "platform/platform_notifications_manager.h"
|
#include "platform/platform_notifications_manager.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "window/notifications_manager.h"
|
#include "window/notifications_manager.h"
|
||||||
#include "window/themes/window_theme.h"
|
#include "window/themes/window_theme.h"
|
||||||
#include "window/themes/window_theme_warning.h"
|
#include "window/themes/window_theme_warning.h"
|
||||||
|
@ -689,7 +690,7 @@ void MainWindow::fixOrder() {
|
||||||
|
|
||||||
void MainWindow::showFromTray(QSystemTrayIcon::ActivationReason reason) {
|
void MainWindow::showFromTray(QSystemTrayIcon::ActivationReason reason) {
|
||||||
if (reason != QSystemTrayIcon::Context) {
|
if (reason != QSystemTrayIcon::Context) {
|
||||||
App::CallDelayed(1, this, [this] {
|
base::call_delayed(1, this, [this] {
|
||||||
updateTrayMenu();
|
updateTrayMenu();
|
||||||
updateGlobalMenu();
|
updateGlobalMenu();
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,9 +8,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "mtproto/dedicated_file_loader.h"
|
#include "mtproto/dedicated_file_loader.h"
|
||||||
|
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "core/application.h"
|
|
||||||
#include "main/main_account.h" // Account::sessionChanges.
|
#include "main/main_account.h" // Account::sessionChanges.
|
||||||
#include "facades.h"
|
#include "core/application.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
|
|
||||||
namespace MTP {
|
namespace MTP {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -321,7 +321,7 @@ void DedicatedLoader::sendRequest() {
|
||||||
_offset += kChunkSize;
|
_offset += kChunkSize;
|
||||||
|
|
||||||
if (_requests.size() < kRequestsCount) {
|
if (_requests.size() < kRequestsCount) {
|
||||||
App::CallDelayed(kNextRequestDelay, this, [=] { sendRequest(); });
|
base::call_delayed(kNextRequestDelay, this, [=] { sendRequest(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "base/unixtime.h"
|
|
||||||
#include "lang/lang_instance.h"
|
#include "lang/lang_instance.h"
|
||||||
#include "lang/lang_cloud_manager.h"
|
#include "lang/lang_cloud_manager.h"
|
||||||
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
|
|
||||||
|
@ -450,7 +451,7 @@ void Instance::Private::requestConfigIfOld() {
|
||||||
void Instance::Private::requestConfigIfExpired() {
|
void Instance::Private::requestConfigIfExpired() {
|
||||||
const auto requestIn = (_configExpiresAt - crl::now());
|
const auto requestIn = (_configExpiresAt - crl::now());
|
||||||
if (requestIn > 0) {
|
if (requestIn > 0) {
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
std::min(requestIn, 3600 * crl::time(1000)),
|
std::min(requestIn, 3600 * crl::time(1000)),
|
||||||
_instance,
|
_instance,
|
||||||
[=] { requestConfigIfExpired(); });
|
[=] { requestConfigIfExpired(); });
|
||||||
|
|
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "mtproto/auth_key.h"
|
#include "mtproto/auth_key.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
#include "base/openssl_help.h"
|
#include "base/openssl_help.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
|
|
||||||
#include <QtCore/QJsonDocument>
|
#include <QtCore/QJsonDocument>
|
||||||
|
@ -415,7 +416,7 @@ void SpecialConfigRequest::sendNextRequest() {
|
||||||
const auto attempt = _attempts.back();
|
const auto attempt = _attempts.back();
|
||||||
_attempts.pop_back();
|
_attempts.pop_back();
|
||||||
if (!_attempts.empty()) {
|
if (!_attempts.empty()) {
|
||||||
App::CallDelayed(kSendNextTimeout, this, [=] {
|
base::call_delayed(kSendNextTimeout, this, [=] {
|
||||||
sendNextRequest();
|
sendNextRequest();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -778,7 +779,7 @@ void DomainResolver::sendNextRequest(const AttemptKey &key) {
|
||||||
list.pop_back();
|
list.pop_back();
|
||||||
|
|
||||||
if (!list.empty()) {
|
if (!list.empty()) {
|
||||||
App::CallDelayed(kSendNextTimeout, &attempts.guard, [=] {
|
base::call_delayed(kSendNextTimeout, &attempts.guard, [=] {
|
||||||
sendNextRequest(key);
|
sendNextRequest(key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/openssl_help.h"
|
#include "base/openssl_help.h"
|
||||||
#include "base/qthelp_url.h"
|
#include "base/qthelp_url.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_user.h"
|
#include "data/data_user.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -28,7 +29,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "storage/file_upload.h"
|
#include "storage/file_upload.h"
|
||||||
#include "storage/file_download.h"
|
#include "storage/file_download.h"
|
||||||
#include "facades.h"
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
|
||||||
#include <QtCore/QJsonDocument>
|
#include <QtCore/QJsonDocument>
|
||||||
|
@ -756,7 +756,7 @@ std::vector<not_null<const Value*>> FormController::submitGetErrors() {
|
||||||
|
|
||||||
_view->showToast(tr::lng_passport_success(tr::now));
|
_view->showToast(tr::lng_passport_success(tr::now));
|
||||||
|
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
(st::toastFadeInDuration
|
(st::toastFadeInDuration
|
||||||
+ Ui::Toast::kDefaultDuration
|
+ Ui::Toast::kDefaultDuration
|
||||||
+ st::toastFadeOutDuration),
|
+ st::toastFadeOutDuration),
|
||||||
|
@ -2669,7 +2669,7 @@ void FormController::cancelSure() {
|
||||||
UrlClickHandler::Open(url);
|
UrlClickHandler::Open(url);
|
||||||
}
|
}
|
||||||
const auto timeout = _view->closeGetDuration();
|
const auto timeout = _view->closeGetDuration();
|
||||||
App::CallDelayed(timeout, this, [=] {
|
base::call_delayed(timeout, this, [=] {
|
||||||
_controller->clearPassportForm();
|
_controller->clearPassportForm();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,16 +7,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "platform/linux/file_utilities_linux.h"
|
#include "platform/linux/file_utilities_linux.h"
|
||||||
|
|
||||||
#include <private/qguiapplication_p.h>
|
|
||||||
#include "platform/linux/linux_libs.h"
|
#include "platform/linux/linux_libs.h"
|
||||||
#include "platform/linux/linux_gdk_helper.h"
|
#include "platform/linux/linux_gdk_helper.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
|
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
#include <private/qguiapplication_p.h>
|
||||||
|
|
||||||
QStringList qt_make_filter_list(const QString &filter);
|
QStringList qt_make_filter_list(const QString &filter);
|
||||||
|
|
||||||
|
@ -419,7 +420,7 @@ int GtkFileDialog::exec() {
|
||||||
show();
|
show();
|
||||||
|
|
||||||
if (const auto parent = parentWidget()) {
|
if (const auto parent = parentWidget()) {
|
||||||
App::CallDelayed(200, parent, [=] {
|
base::call_delayed(200, parent, [=] {
|
||||||
parent->activateWindow();
|
parent->activateWindow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_cloud_themes.h"
|
#include "data/data_cloud_themes.h"
|
||||||
#include "chat_helpers/emoji_sets_manager.h"
|
#include "chat_helpers/emoji_sets_manager.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "support/support_common.h"
|
#include "support/support_common.h"
|
||||||
#include "support/support_templates.h"
|
#include "support/support_templates.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
@ -809,7 +810,7 @@ void SetupExport(
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
const auto session = &controller->session();
|
const auto session = &controller->session();
|
||||||
Ui::hideSettingsAndLayer();
|
Ui::hideSettingsAndLayer();
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
st::boxDuration,
|
st::boxDuration,
|
||||||
session,
|
session,
|
||||||
[=] { session->data().startExport(); });
|
[=] { session->data().startExport(); });
|
||||||
|
|
|
@ -30,7 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "facades.h"
|
#include "base/call_delayed.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
@ -367,7 +367,7 @@ BioManager SetupBio(
|
||||||
) | rpl::start_with_next([=](bool changed) {
|
) | rpl::start_with_next([=](bool changed) {
|
||||||
if (changed) {
|
if (changed) {
|
||||||
const auto saved = *generation = std::abs(*generation) + 1;
|
const auto saved = *generation = std::abs(*generation) + 1;
|
||||||
App::CallDelayed(kSaveBioTimeout, bio, [=] {
|
base::call_delayed(kSaveBioTimeout, bio, [=] {
|
||||||
if (*generation == saved) {
|
if (*generation == saved) {
|
||||||
save(nullptr);
|
save(nullptr);
|
||||||
*generation = 0;
|
*generation = 0;
|
||||||
|
|
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
@ -176,7 +177,7 @@ void SetupInterfaceScale(
|
||||||
App::restart();
|
App::restart();
|
||||||
});
|
});
|
||||||
const auto cancelled = crl::guard(button, [=] {
|
const auto cancelled = crl::guard(button, [=] {
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
st::defaultSettingsSlider.duration,
|
st::defaultSettingsSlider.duration,
|
||||||
button,
|
button,
|
||||||
[=] { (*setScale)(cConfigScale()); });
|
[=] { (*setScale)(cConfigScale()); });
|
||||||
|
|
|
@ -19,9 +19,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "facades.h"
|
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_window.h"
|
#include "styles/style_window.h"
|
||||||
#include "styles/style_layers.h"
|
#include "styles/style_layers.h"
|
||||||
|
@ -426,7 +426,7 @@ void Autocomplete::setupContent() {
|
||||||
|
|
||||||
inner->activated() | rpl::start_with_next(submit, lifetime());
|
inner->activated() | rpl::start_with_next(submit, lifetime());
|
||||||
connect(input, &Ui::InputField::blurred, [=] {
|
connect(input, &Ui::InputField::blurred, [=] {
|
||||||
App::CallDelayed(10, this, [=] {
|
base::call_delayed(10, this, [=] {
|
||||||
if (!input->hasFocus()) {
|
if (!input->hasFocus()) {
|
||||||
deactivate();
|
deactivate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "base/crc32hash.h"
|
#include "base/crc32hash.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "ui/toast/toast.h"
|
#include "ui/toast/toast.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
|
@ -348,7 +349,7 @@ void MainWindow::handleActiveChanged() {
|
||||||
if (isActiveWindow()) {
|
if (isActiveWindow()) {
|
||||||
Core::App().checkMediaViewActivation();
|
Core::App().checkMediaViewActivation();
|
||||||
}
|
}
|
||||||
App::CallDelayed(1, this, [this] {
|
base::call_delayed(1, this, [this] {
|
||||||
updateTrayMenu();
|
updateTrayMenu();
|
||||||
handleActiveChangedHook();
|
handleActiveChangedHook();
|
||||||
});
|
});
|
||||||
|
@ -590,7 +591,7 @@ void MainWindow::reActivateWindow() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
crl::on_main(this, reActivate);
|
crl::on_main(this, reActivate);
|
||||||
App::CallDelayed(200, this, reActivate);
|
base::call_delayed(200, this, reActivate);
|
||||||
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
#endif // Q_OS_LINUX32 || Q_OS_LINUX64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "history/history_item.h"
|
#include "history/history_item.h"
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
|
@ -402,7 +403,7 @@ void Widget::destroyDelayed() {
|
||||||
_deleted = true;
|
_deleted = true;
|
||||||
|
|
||||||
// Ubuntu has a lag if a fully transparent widget is destroyed immediately.
|
// Ubuntu has a lag if a fully transparent widget is destroyed immediately.
|
||||||
App::CallDelayed(1000, this, [this] {
|
base::call_delayed(1000, this, [this] {
|
||||||
manager()->removeWidget(this);
|
manager()->removeWidget(this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -433,7 +434,7 @@ bool Widget::shiftAnimationCallback(crl::time now) {
|
||||||
void Widget::hideSlow() {
|
void Widget::hideSlow() {
|
||||||
if (anim::Disabled()) {
|
if (anim::Disabled()) {
|
||||||
_hiding = true;
|
_hiding = true;
|
||||||
App::CallDelayed(
|
base::call_delayed(
|
||||||
st::notifySlowHide,
|
st::notifySlowHide,
|
||||||
this,
|
this,
|
||||||
[=, guard = _hidingDelayed.make_guard()] {
|
[=, guard = _hidingDelayed.make_guard()] {
|
||||||
|
|
|
@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "base/parse_helper.h"
|
#include "base/parse_helper.h"
|
||||||
#include "base/zlib_help.h"
|
#include "base/zlib_help.h"
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "boxes/edit_color_box.h"
|
#include "boxes/edit_color_box.h"
|
||||||
|
@ -419,7 +420,7 @@ Editor::Inner::Inner(QWidget *parent, const QString &path) : TWidget(parent)
|
||||||
|
|
||||||
if (update.type == BackgroundUpdate::Type::TestingTheme) {
|
if (update.type == BackgroundUpdate::Type::TestingTheme) {
|
||||||
Revert();
|
Revert();
|
||||||
App::CallDelayed(st::slideDuration, this, [] {
|
base::call_delayed(st::slideDuration, this, [] {
|
||||||
Ui::show(Box<InformBox>(
|
Ui::show(Box<InformBox>(
|
||||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||||
});
|
});
|
||||||
|
@ -674,7 +675,9 @@ Editor::Editor(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
_inner->setFocusCallback([this] {
|
_inner->setFocusCallback([this] {
|
||||||
App::CallDelayed(2 * st::boxDuration, this, [this] { _select->setInnerFocus(); });
|
base::call_delayed(2 * st::boxDuration, this, [this] {
|
||||||
|
_select->setInnerFocus();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
_inner->setScrollCallback([this](int top, int bottom) {
|
_inner->setScrollCallback([this](int top, int bottom) {
|
||||||
_scroll->scrollToY(top, bottom);
|
_scroll->scrollToY(top, bottom);
|
||||||
|
@ -720,12 +723,12 @@ void Editor::showMenu() {
|
||||||
|
|
||||||
_menuToggle->installEventFilter(_menu);
|
_menuToggle->installEventFilter(_menu);
|
||||||
_menu->addAction(tr::lng_theme_editor_menu_export(tr::now), [=] {
|
_menu->addAction(tr::lng_theme_editor_menu_export(tr::now), [=] {
|
||||||
App::CallDelayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
base::call_delayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
||||||
exportTheme();
|
exportTheme();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
_menu->addAction(tr::lng_theme_editor_menu_import(tr::now), [=] {
|
_menu->addAction(tr::lng_theme_editor_menu_import(tr::now), [=] {
|
||||||
App::CallDelayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
base::call_delayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
||||||
importTheme();
|
importTheme();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/shadow.h"
|
#include "ui/widgets/shadow.h"
|
||||||
#include "boxes/edit_color_box.h"
|
#include "boxes/edit_color_box.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "facades.h"
|
#include "base/call_delayed.h"
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
namespace Theme {
|
namespace Theme {
|
||||||
|
@ -522,7 +522,7 @@ void EditorBlock::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
if (_context->box) {
|
if (_context->box) {
|
||||||
chooseRow();
|
chooseRow();
|
||||||
} else if (_selected >= 0) {
|
} else if (_selected >= 0) {
|
||||||
App::CallDelayed(st::defaultRippleAnimation.hideDuration, this, [this, index = findRowIndex(&rowAtIndex(_selected))] {
|
base::call_delayed(st::defaultRippleAnimation.hideDuration, this, [this, index = findRowIndex(&rowAtIndex(_selected))] {
|
||||||
if (index >= 0 && index < _data.size()) {
|
if (index >= 0 && index < _data.size()) {
|
||||||
activateRow(_data[index]);
|
activateRow(_data[index]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue