Use qualified names for App::main and App::wnd.

This commit is contained in:
John Preston 2018-12-04 16:10:00 +04:00
parent 2eb3041c1f
commit c259921269
2 changed files with 9 additions and 9 deletions

View File

@ -1529,12 +1529,12 @@ namespace App {
} }
setLaunchState(QuitRequested); setLaunchState(QuitRequested);
if (auto window = wnd()) { if (auto window = App::wnd()) {
if (!Sandbox::isSavingSession()) { if (!Sandbox::isSavingSession()) {
window->hide(); window->hide();
} }
} }
if (auto mainwidget = main()) { if (auto mainwidget = App::main()) {
mainwidget->saveDraftToCloud(); mainwidget->saveDraftToCloud();
} }
Messenger::QuitAttempt(); Messenger::QuitAttempt();

View File

@ -38,19 +38,19 @@ void CallDelayed(int duration, FnMut<void()> &&lambda) {
} // namespace internal } // namespace internal
void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) { void sendBotCommand(PeerData *peer, UserData *bot, const QString &cmd, MsgId replyTo) {
if (auto m = main()) { if (auto m = App::main()) {
m->sendBotCommand(peer, bot, cmd, replyTo); m->sendBotCommand(peer, bot, cmd, replyTo);
} }
} }
void hideSingleUseKeyboard(const HistoryItem *msg) { void hideSingleUseKeyboard(const HistoryItem *msg) {
if (auto m = main()) { if (auto m = App::main()) {
m->hideSingleUseKeyboard(msg->history()->peer, msg->id); m->hideSingleUseKeyboard(msg->history()->peer, msg->id);
} }
} }
bool insertBotCommand(const QString &cmd) { bool insertBotCommand(const QString &cmd) {
if (auto m = main()) { if (auto m = App::main()) {
return m->insertBotCommand(cmd); return m->insertBotCommand(cmd);
} }
return false; return false;
@ -82,7 +82,7 @@ void activateBotCommand(
case ButtonType::Callback: case ButtonType::Callback:
case ButtonType::Game: { case ButtonType::Game: {
if (auto m = main()) { if (auto m = App::main()) {
m->app_sendBotCallback(button, msg, row, column); m->app_sendBotCallback(button, msg, row, column);
} }
} break; } break;
@ -149,7 +149,7 @@ void activateBotCommand(
} }
void searchByHashtag(const QString &tag, PeerData *inPeer) { void searchByHashtag(const QString &tag, PeerData *inPeer) {
if (const auto m = main()) { if (const auto m = App::main()) {
Ui::hideSettingsAndLayer(); Ui::hideSettingsAndLayer();
Messenger::Instance().hideMediaView(); Messenger::Instance().hideMediaView();
if (inPeer && (!inPeer->isChannel() || inPeer->isMegagroup())) { if (inPeer && (!inPeer->isChannel() || inPeer->isMegagroup())) {
@ -164,13 +164,13 @@ void searchByHashtag(const QString &tag, PeerData *inPeer) {
} }
void showSettings() { void showSettings() {
if (auto w = wnd()) { if (auto w = App::wnd()) {
w->showSettings(); w->showSettings();
} }
} }
void activateClickHandler(ClickHandlerPtr handler, ClickContext context) { void activateClickHandler(ClickHandlerPtr handler, ClickContext context) {
crl::on_main(wnd(), [=] { crl::on_main(App::wnd(), [=] {
handler->onClick(context); handler->onClick(context);
}); });
} }