mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Moved AppClass to messenger.cpp:Messenger.
This commit is contained in:
@@ -25,10 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
SingleTimer::SingleTimer(QObject *parent) : QTimer(parent) {
|
||||
QTimer::setSingleShot(true);
|
||||
if (App::app()) {
|
||||
connect(App::app(), SIGNAL(adjustSingleTimers()), this, SLOT(adjust()));
|
||||
_inited = true;
|
||||
}
|
||||
Sandbox::connect(SIGNAL(adjustSingleTimers()), this, SLOT(adjust()));
|
||||
}
|
||||
|
||||
void SingleTimer::setTimeoutHandler(base::lambda<void()> &&handler) {
|
||||
@@ -59,10 +56,6 @@ void SingleTimer::onTimeout() {
|
||||
|
||||
void SingleTimer::start(int msec) {
|
||||
_finishing = getms(true) + (msec < 0 ? 0 : msec);
|
||||
if (!_inited && App::app()) {
|
||||
connect(App::app(), SIGNAL(adjustSingleTimers()), this, SLOT(adjust()));
|
||||
_inited = true;
|
||||
}
|
||||
QTimer::start(msec);
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,6 @@ private slots:
|
||||
|
||||
private:
|
||||
TimeMs _finishing = 0;
|
||||
bool _inited = false;
|
||||
base::lambda<void()> _handler;
|
||||
|
||||
};
|
||||
|
@@ -35,6 +35,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include "application.h"
|
||||
#include "pspecific.h"
|
||||
|
||||
uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 };
|
||||
|
||||
@@ -320,7 +321,6 @@ namespace ThirdParty {
|
||||
|
||||
Platform::ThirdParty::finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool checkms() {
|
||||
@@ -330,7 +330,7 @@ bool checkms() {
|
||||
_msAddToUnixtime = ((ms - unixms) / 1000LL) * 1000LL;
|
||||
} else if (unixms > ms + 1000LL) {
|
||||
_msAddToMsStart += ((unixms - ms) / 1000LL) * 1000LL;
|
||||
if (App::app()) emit App::app()->adjustSingleTimers();
|
||||
Sandbox::adjustSingleTimers();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user