mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Remove MTP::MainInstance() global access point.
This commit is contained in:
@@ -107,7 +107,6 @@ public:
|
||||
ShiftedDcId shiftedDcId,
|
||||
AuthKeyPtr &&key = nullptr);
|
||||
void removeDc(ShiftedDcId shiftedDcId);
|
||||
void unpaused();
|
||||
|
||||
void sendRequest(
|
||||
mtpRequestId requestId,
|
||||
@@ -169,6 +168,8 @@ private:
|
||||
bool exportFail(const RPCError &error, mtpRequestId requestId);
|
||||
bool onErrorDefault(mtpRequestId requestId, const RPCError &error);
|
||||
|
||||
void unpaused();
|
||||
|
||||
Session *findSession(ShiftedDcId shiftedDcId);
|
||||
not_null<Session*> startSession(ShiftedDcId shiftedDcId);
|
||||
Session *removeSession(ShiftedDcId shiftedDcId);
|
||||
@@ -270,6 +271,10 @@ Instance::Private::Private(
|
||||
, _mode(mode) {
|
||||
const auto idealThreadPoolSize = QThread::idealThreadCount();
|
||||
_fileSessionThreads.resize(2 * std::max(idealThreadPoolSize / 2, 1));
|
||||
details::unpaused(
|
||||
) | rpl::start_with_next([=] {
|
||||
unpaused();
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
void Instance::Private::start(Config &&config) {
|
||||
@@ -1794,10 +1799,6 @@ QString Instance::systemVersion() const {
|
||||
return _private->systemVersion();
|
||||
}
|
||||
|
||||
void Instance::unpaused() {
|
||||
_private->unpaused();
|
||||
}
|
||||
|
||||
void Instance::setUpdatesHandler(RPCDoneHandlerPtr onDone) {
|
||||
_private->setUpdatesHandler(onDone);
|
||||
}
|
||||
|
Reference in New Issue
Block a user