2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Move MTP::Instance to Main::Account.

This commit is contained in:
John Preston
2019-07-24 10:46:23 +02:00
parent db2018c765
commit 9cf4cf6dca
32 changed files with 715 additions and 526 deletions

View File

@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localstorage.h"
#include "base/qthelp_url.h"
#include "core/application.h"
#include "main/main_account.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/input_fields.h"
@@ -1045,7 +1046,7 @@ void ProxiesBoxController::refreshChecker(Item &item) {
const auto type = (item.data.type == Type::Http)
? Variants::Http
: Variants::Tcp;
const auto mtproto = Core::App().mtp();
const auto mtproto = Core::App().activeAccount().mtp();
const auto dcId = mtproto->mainDcId();
item.state = ItemState::Checking;

View File

@@ -1155,13 +1155,13 @@ not_null<Ui::MultiSelect*> LanguageBox::createMultiSelect() {
base::binary_guard LanguageBox::Show() {
auto result = base::binary_guard();
const auto manager = Core::App().langCloudManager();
if (manager->languageList().empty()) {
auto &manager = Lang::CurrentCloudManager();
if (manager.languageList().empty()) {
auto guard = std::make_shared<base::binary_guard>(
result.make_guard());
auto alive = std::make_shared<std::unique_ptr<base::Subscription>>(
std::make_unique<base::Subscription>());
**alive = manager->languageListChanged().add_subscription([=] {
**alive = manager.languageListChanged().add_subscription([=] {
const auto show = guard->alive();
*alive = nullptr;
if (show) {
@@ -1171,7 +1171,7 @@ base::binary_guard LanguageBox::Show() {
} else {
Ui::show(Box<LanguageBox>());
}
manager->requestLanguageList();
manager.requestLanguageList();
return result;
}