2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix build for OS X 10.6-10.7.

Qt 5.3.2 doesn't support QTimer::singleShot(delay, lambda).
This commit is contained in:
John Preston
2017-04-11 18:44:11 +03:00
parent b736d45bc4
commit d4af14041c
5 changed files with 6 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ namespace {
constexpr auto kReloadChannelMembersTimeout = 1000; // 1 second wait before reload members in channel after adding
constexpr auto kSaveCloudDraftTimeout = 1000; // save draft to the cloud with 1 sec extra delay
constexpr auto kSaveDraftBeforeQuitTimeout = 1500; // give the app 1.5 secs to save drafts to cloud when quitting
constexpr auto kSmallDelayMs = 5;
} // namespace
@@ -45,7 +46,8 @@ constexpr auto kSmallDelayMs = 5;
ApiWrap::ApiWrap()
: _messageDataResolveDelayed([this] { resolveMessageDatas(); })
, _webPagesTimer([this] { resolveWebPages(); })
, _draftsSaveTimer([this] { saveDraftsToCloud(); }) {
, _draftsSaveTimer([this] { saveDraftsToCloud(); })
, _quitSavingDraftsTimer([] { App::allDraftsSaved(); }) {
Window::Theme::Background()->start();
}
@@ -1164,6 +1166,8 @@ void ApiWrap::saveDraftsToCloud() {
}
if (_draftsSaveRequestIds.isEmpty()) {
App::allDraftsSaved(); // can quit the application
} else if (App::quitting() && !_quitSavingDraftsTimer.isActive()) {
_quitSavingDraftsTimer.callOnce(kSaveDraftBeforeQuitTimeout);
}
}