mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-27 02:51:12 +00:00
Fixed crash on creating of callback for adding items to non-exist menu.
This commit is contained in:
parent
3887fbc437
commit
3e428faa2e
@ -690,13 +690,13 @@ void SetupAccountsWrap(
|
|||||||
} else if (which != Qt::RightButton) {
|
} else if (which != Qt::RightButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto addAction = Ui::Menu::CreateAddActionCallback(
|
|
||||||
state->menu);
|
|
||||||
if (!state->menu && IsAltShift(raw->clickModifiers()) && !locked) {
|
if (!state->menu && IsAltShift(raw->clickModifiers()) && !locked) {
|
||||||
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
||||||
raw,
|
raw,
|
||||||
st::popupMenuWithIcons);
|
st::popupMenuWithIcons);
|
||||||
Window::MenuAddMarkAsReadAllChatsAction(window, addAction);
|
Window::MenuAddMarkAsReadAllChatsAction(
|
||||||
|
window,
|
||||||
|
Ui::Menu::CreateAddActionCallback(state->menu));
|
||||||
state->menu->popup(QCursor::pos());
|
state->menu->popup(QCursor::pos());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -707,6 +707,8 @@ void SetupAccountsWrap(
|
|||||||
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
||||||
raw,
|
raw,
|
||||||
st::popupMenuWithIcons);
|
st::popupMenuWithIcons);
|
||||||
|
const auto addAction = Ui::Menu::CreateAddActionCallback(
|
||||||
|
state->menu);
|
||||||
addAction(tr::lng_profile_copy_phone(tr::now), [=] {
|
addAction(tr::lng_profile_copy_phone(tr::now), [=] {
|
||||||
const auto phone = rpl::variable<TextWithEntities>(
|
const auto phone = rpl::variable<TextWithEntities>(
|
||||||
Info::Profile::PhoneValue(session->user()));
|
Info::Profile::PhoneValue(session->user()));
|
||||||
|
Loading…
Reference in New Issue
Block a user