2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +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

@@ -200,7 +200,7 @@ void MainWindow::clearPasscodeLock() {
_main->showAnimated(bg, true);
Core::App().checkStartUrl();
} else {
Core::App().startMtp();
account().startMtp();
if (account().sessionExists()) {
setupMain();
} else {
@@ -216,7 +216,7 @@ void MainWindow::setupIntro() {
auto bg = animated ? grabInner() : QPixmap();
clearWidgets();
_intro.create(bodyWidget());
_intro.create(bodyWidget(), &account());
updateControlsGeometry();
if (animated) {
@@ -619,16 +619,15 @@ void MainWindow::onLogout() {
showFromTray();
}
const auto logout = [] {
Core::App().logOut();
};
const auto callback = [=] {
if (account().sessionExists()
&& account().session().data().exportInProgress()) {
Ui::hideLayer();
account().session().data().stopExportWithConfirmation(logout);
account().session().data().stopExportWithConfirmation([=] {
account().logOut();
});
} else {
logout();
account().logOut();
}
};
Ui::show(Box<ConfirmBox>(