Fix build with GCC.

This commit is contained in:
John Preston 2022-11-02 08:51:03 +04:00
parent 45cacc94c0
commit fdf4129e5e
28 changed files with 28 additions and 64 deletions

View file

@ -3487,7 +3487,6 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
HistoryItem *lastMessage = nullptr; HistoryItem *lastMessage = nullptr;
auto &histories = history->owner().histories(); auto &histories = history->owner().histories();
const auto requestType = Data::Histories::RequestType::Send;
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) { while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
auto newId = FullMsgId( auto newId = FullMsgId(

View file

@ -261,9 +261,7 @@ struct IconSelector {
selector->provideRecent(recent()); selector->provideRecent(recent());
}, selector->lifetime()); }, selector->lifetime());
auto ownedFooter = selector->createFooter(); placeFooter(selector->createFooter());
const auto footer = ownedFooter.data();
placeFooter(std::move(ownedFooter));
const auto shadow = Ui::CreateChild<Ui::PlainShadow>(box.get()); const auto shadow = Ui::CreateChild<Ui::PlainShadow>(box.get());
shadow->show(); shadow->show();

View file

@ -1186,7 +1186,6 @@ object_ptr<Ui::BoxContent> ShareInviteLinkBox(
} else { } else {
comment.text = link; comment.text = link;
} }
const auto owner = &peer->owner();
auto &api = peer->session().api(); auto &api = peer->session().api();
for (const auto thread : result) { for (const auto thread : result) {
auto message = Api::MessageToSend( auto message = Api::MessageToSend(

View file

@ -1125,25 +1125,21 @@ void ShareBox::Inner::chooseForumTopic(not_null<Data::Forum*> forum) {
updateChatName(chat); updateChatName(chat);
changePeerCheckState(chat, true); changePeerCheckState(chat, true);
}; };
auto initBox = [](not_null<PeerListBox*> box) { auto initBox = [=](not_null<PeerListBox*> box) {
box->addButton(tr::lng_cancel(), [box] { box->addButton(tr::lng_cancel(), [=] {
box->closeBox(); box->closeBox();
}); });
forum->destroyed(
) | rpl::start_with_next([=] {
box->closeBox();
}, box->lifetime());
}; };
auto box = Box<PeerListBox>( auto box = Box<PeerListBox>(
std::make_unique<ChooseTopicBoxController>( std::make_unique<ChooseTopicBoxController>(
forum, forum,
std::move(chosen)), std::move(chosen)),
[=](not_null<PeerListBox*> box) { std::move(initBox));
box->addButton(tr::lng_cancel(), [=] {
box->closeBox();
});
forum->destroyed(
) | rpl::start_with_next([=] {
box->closeBox();
}, box->lifetime());
});
*weak = box.data(); *weak = box.data();
_show->showBox(std::move(box)); _show->showBox(std::move(box));
} }

View file

@ -180,7 +180,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
} else { } else {
comment.text = link; comment.text = link;
} }
const auto owner = &peer->owner();
auto &api = peer->session().api(); auto &api = peer->session().api();
for (const auto thread : result) { for (const auto thread : result) {
auto message = Api::MessageToSend( auto message = Api::MessageToSend(

View file

@ -141,7 +141,7 @@ void BotKeyboard::paintEvent(QPaintEvent *e) {
_impl->paint( _impl->paint(
p, p,
nullptr, nullptr,
{}, Ui::BubbleRounding(),
width(), width(),
clip.translated(-x, -st::botKbScroll.deltat)); clip.translated(-x, -st::botKbScroll.deltat));
} }
@ -249,7 +249,7 @@ void BotKeyboard::clickHandlerActiveChanged(const ClickHandlerPtr &p, bool activ
void BotKeyboard::clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pressed) { void BotKeyboard::clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pressed) {
if (!_impl) return; if (!_impl) return;
_impl->clickHandlerPressedChanged(p, pressed, {}); _impl->clickHandlerPressedChanged(p, pressed, Ui::BubbleRounding());
} }
bool BotKeyboard::updateMarkup(HistoryItem *to, bool force) { bool BotKeyboard::updateMarkup(HistoryItem *to, bool force) {

View file

@ -450,9 +450,7 @@ void ForumTopic::setLastMessage(HistoryItem *item) {
void ForumTopic::setChatListMessage(HistoryItem *item) { void ForumTopic::setChatListMessage(HistoryItem *item) {
if (_chatListMessage && *_chatListMessage == item) { if (_chatListMessage && *_chatListMessage == item) {
return; return;
} } else if (item) {
const auto was = _chatListMessage.value_or(nullptr);
if (item) {
if (item->isSponsored()) { if (item->isSponsored()) {
return; return;
} }

View file

@ -151,7 +151,6 @@ void Groups::refreshViews(const HistoryItemsList &items) {
if (items.empty()) { if (items.empty()) {
return; return;
} }
const auto history = items.front()->history();
for (const auto &item : items) { for (const auto &item : items) {
_data->requestItemViewRefresh(item); _data->requestItemViewRefresh(item);
item->invalidateChatListEntry(); item->invalidateChatListEntry();

View file

@ -962,7 +962,6 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realRoot) {
std::move(entry.done), std::move(entry.done),
std::move(entry.fail)); std::move(entry.fail));
} }
const auto topic = history->peer->forumTopicFor(realRoot);
for (const auto &item : history->clientSideMessages()) { for (const auto &item : history->clientSideMessages()) {
const auto replace = [&](MsgId nowId) { const auto replace = [&](MsgId nowId) {
return (nowId == rootId.msg) ? realRoot : nowId; return (nowId == rootId.msg) ? realRoot : nowId;

View file

@ -953,7 +953,6 @@ void Widget::jumpToTop(bool belowPinned) {
controller()->activeChatsFilterCurrent()) controller()->activeChatsFilterCurrent())
: session().data().chatsList(_openedFolder); : session().data().chatsList(_openedFolder);
const auto count = int(list->pinned()->order().size()); const auto count = int(list->pinned()->order().size());
const auto now = _scroll->scrollTop();
const auto row = _inner->st()->height; const auto row = _inner->st()->height;
const auto min = (row * (count * 2 + 1) - _scroll->height()) / 2; const auto min = (row * (count * 2 + 1) - _scroll->height()) / 2;
if (_scroll->scrollTop() <= min) { if (_scroll->scrollTop() <= min) {
@ -1573,8 +1572,6 @@ void Widget::searchReceived(
_lastSearchPeer = nullptr; _lastSearchPeer = nullptr;
_lastSearchId = _lastSearchMigratedId = 0; _lastSearchId = _lastSearchMigratedId = 0;
} }
const auto isGlobalSearch = (type == SearchRequestType::FromStart)
|| (type == SearchRequestType::FromOffset);
const auto isMigratedSearch = (type == SearchRequestType::MigratedFromStart) const auto isMigratedSearch = (type == SearchRequestType::MigratedFromStart)
|| (type == SearchRequestType::MigratedFromOffset); || (type == SearchRequestType::MigratedFromOffset);
const auto process = [&](const MTPVector<MTPMessage> &messages) { const auto process = [&](const MTPVector<MTPMessage> &messages) {

View file

@ -112,7 +112,6 @@ void ForwardPanel::updateTexts() {
_text.clear(); _text.clear();
return; return;
} }
int32 version = 0;
QString from; QString from;
TextWithEntities text; TextWithEntities text;
const auto keepNames = (_data.options const auto keepNames = (_data.options

View file

@ -651,8 +651,6 @@ void ListWidget::showAtPosition(
anim::type animated, anim::type animated,
Fn<void(bool found)> done) { Fn<void(bool found)> done) {
const auto showAtUnread = (position == Data::UnreadMessagePosition); const auto showAtUnread = (position == Data::UnreadMessagePosition);
const auto showAtStart = (position == Data::MinMessagePosition);
const auto showAtEnd = (position == Data::MaxMessagePosition);
if (showAtUnread && jumpToBottomInsteadOfUnread()) { if (showAtUnread && jumpToBottomInsteadOfUnread()) {
showAtPosition(Data::MaxMessagePosition, animated, std::move(done)); showAtPosition(Data::MaxMessagePosition, animated, std::move(done));

View file

@ -3133,7 +3133,7 @@ Ui::BubbleRounding Message::countMessageRounding() const {
|| (context() == Context::Replies && data()->isDiscussionPost()); || (context() == Context::Replies && data()->isDiscussionPost());
const auto right = !delegate()->elementIsChatWide() && hasOutLayout(); const auto right = !delegate()->elementIsChatWide() && hasOutLayout();
using Corner = Ui::BubbleCornerRounding; using Corner = Ui::BubbleCornerRounding;
return { return Ui::BubbleRounding{
.topLeft = (smallTop && !right) ? Corner::Small : Corner::Large, .topLeft = (smallTop && !right) ? Corner::Small : Corner::Large,
.topRight = (smallTop && right) ? Corner::Small : Corner::Large, .topRight = (smallTop && right) ? Corner::Small : Corner::Large,
.bottomLeft = ((smallBottom && !right) .bottomLeft = ((smallBottom && !right)

View file

@ -1934,7 +1934,6 @@ bool RepliesWidget::showMessage(
if (!message) { if (!message) {
return false; return false;
} }
auto originFound = false;
const auto originMessage = [&]() -> HistoryItem* { const auto originMessage = [&]() -> HistoryItem* {
using OriginMessage = Window::SectionShow::OriginMessage; using OriginMessage = Window::SectionShow::OriginMessage;
if (const auto origin = std::get_if<OriginMessage>(&params.origin)) { if (const auto origin = std::get_if<OriginMessage>(&params.origin)) {

View file

@ -760,7 +760,7 @@ Ui::BubbleRounding Document::thumbRounding(
Ui::BubbleRounding outsideRounding) const { Ui::BubbleRounding outsideRounding) const {
using Corner = Ui::BubbleCornerRounding; using Corner = Ui::BubbleCornerRounding;
if (mode != LayoutMode::Grouped && _parent->media() != this) { if (mode != LayoutMode::Grouped && _parent->media() != this) {
return {}; // In a WebPage preview. return Ui::BubbleRounding(); // In a WebPage preview.
} }
const auto hasCaption = Has<HistoryDocumentCaptioned>(); const auto hasCaption = Has<HistoryDocumentCaptioned>();
const auto adjust = [&](Corner already, bool skip = false) { const auto adjust = [&](Corner already, bool skip = false) {

View file

@ -195,8 +195,6 @@ int ExtendedPreview::minWidthForButton() const {
void ExtendedPreview::draw(Painter &p, const PaintContext &context) const { void ExtendedPreview::draw(Painter &p, const PaintContext &context) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
const auto st = context.st;
const auto sti = context.imageStyle();
const auto stm = context.messageStyle(); const auto stm = context.messageStyle();
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto bubble = _parent->hasBubble(); auto bubble = _parent->hasBubble();

View file

@ -1110,8 +1110,6 @@ void Gif::drawGrouped(
const auto radial = isRadialAnimation() const auto radial = isRadialAnimation()
|| (streamedForWaiting && streamedForWaiting->waitingShown()); || (streamedForWaiting && streamedForWaiting->waitingShown());
const auto roundRadius = ImageRoundRadius::Large;
if (streamed) { if (streamed) {
const auto original = sizeForAspectRatio(); const auto original = sizeForAspectRatio();
const auto originalWidth = style::ConvertScale(original.width()); const auto originalWidth = style::ConvertScale(original.width());

View file

@ -160,7 +160,6 @@ void Location::draw(Painter &p, const PaintContext &context) const {
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintx = 0, painty = 0, paintw = width(), painth = height();
bool bubble = _parent->hasBubble(); bool bubble = _parent->hasBubble();
const auto st = context.st; const auto st = context.st;
const auto sti = context.imageStyle();
const auto stm = context.messageStyle(); const auto stm = context.messageStyle();
const auto hasText = !_title.isEmpty() || !_description.isEmpty(); const auto hasText = !_title.isEmpty() || !_description.isEmpty();

View file

@ -582,7 +582,6 @@ void Photo::drawGrouped(
: highlightOpacity; : highlightOpacity;
if (overlayOpacity > 0.) { if (overlayOpacity > 0.) {
p.setOpacity(overlayOpacity); p.setOpacity(overlayOpacity);
const auto roundRadius = ImageRoundRadius::Large;
fillImageOverlay(p, geometry, rounding, context); fillImageOverlay(p, geometry, rounding, context);
if (!context.selected()) { if (!context.selected()) {
fillImageOverlay(p, geometry, rounding, context); fillImageOverlay(p, geometry, rounding, context);

View file

@ -176,8 +176,6 @@ void ThemeDocument::draw(Painter &p, const PaintContext &context) const {
const auto radial = isRadialAnimation(); const auto radial = isRadialAnimation();
auto rthumb = style::rtlrect(paintx, painty, paintw, painth, width()); auto rthumb = style::rtlrect(paintx, painty, paintw, painth, width());
auto roundRadius = ImageRoundRadius::Small;
auto roundCorners = RectPart::AllCorners;
validateThumbnail(); validateThumbnail();
p.drawPixmap(rthumb.topLeft(), _thumbnail); p.drawPixmap(rthumb.topLeft(), _thumbnail);
if (context.selected()) { if (context.selected()) {

View file

@ -210,7 +210,6 @@ void Controller::setupMigrationViewer() {
void Controller::replaceWith(std::shared_ptr<Memento> memento) { void Controller::replaceWith(std::shared_ptr<Memento> memento) {
const auto window = parentController(); const auto window = parentController();
const auto section = _section;
auto params = Window::SectionShow( auto params = Window::SectionShow(
Window::SectionShow::Way::Backward, Window::SectionShow::Way::Backward,
anim::type::instant, anim::type::instant,

View file

@ -516,7 +516,6 @@ bool MainWidget::setForwardDraft(
not_null<Data::Thread*> thread, not_null<Data::Thread*> thread,
Data::ForwardDraft &&draft) { Data::ForwardDraft &&draft) {
const auto history = thread->owningHistory(); const auto history = thread->owningHistory();
const auto peer = history->peer;
const auto items = session().data().idsToItems(draft.ids); const auto items = session().data().idsToItems(draft.ids);
const auto topicRootId = thread->topicRootId(); const auto topicRootId = thread->topicRootId();
const auto error = GetErrorTextForSending( const auto error = GetErrorTextForSending(

View file

@ -787,6 +787,7 @@ public:
void showNotification( void showNotification(
not_null<PeerData*> peer, not_null<PeerData*> peer,
MsgId topicRootId,
std::shared_ptr<Data::CloudImageView> &userpicView, std::shared_ptr<Data::CloudImageView> &userpicView,
MsgId msgId, MsgId msgId,
const QString &title, const QString &title,
@ -1061,6 +1062,7 @@ Manager::~Manager() = default;
void Manager::doShowNativeNotification( void Manager::doShowNativeNotification(
not_null<PeerData*> peer, not_null<PeerData*> peer,
MsgId topicRootId,
std::shared_ptr<Data::CloudImageView> &userpicView, std::shared_ptr<Data::CloudImageView> &userpicView,
MsgId msgId, MsgId msgId,
const QString &title, const QString &title,
@ -1069,6 +1071,7 @@ void Manager::doShowNativeNotification(
DisplayOptions options) { DisplayOptions options) {
_private->showNotification( _private->showNotification(
peer, peer,
topicRootId,
userpicView, userpicView,
msgId, msgId,
title, title,

View file

@ -21,6 +21,7 @@ public:
protected: protected:
void doShowNativeNotification( void doShowNativeNotification(
not_null<PeerData*> peer, not_null<PeerData*> peer,
MsgId topicRootId,
std::shared_ptr<Data::CloudImageView> &userpicView, std::shared_ptr<Data::CloudImageView> &userpicView,
MsgId msgId, MsgId msgId,
const QString &title, const QString &title,

View file

@ -514,7 +514,6 @@ void LayerWidget::paintEvent(QPaintEvent *e) {
auto clip = e->rect(); auto clip = e->rect();
auto r = st::boxRadius; auto r = st::boxRadius;
auto parts = RectPart::None | 0;
const auto &pixmaps = Ui::CachedCornerPixmaps(Ui::BoxCorners); const auto &pixmaps = Ui::CachedCornerPixmaps(Ui::BoxCorners);
if (!_tillTop && clip.intersects({ 0, 0, width(), r })) { if (!_tillTop && clip.intersects({ 0, 0, width(), r })) {
Ui::FillRoundRect(p, 0, 0, width(), r, st::boxBg, { Ui::FillRoundRect(p, 0, 0, width(), r, st::boxBg, {

View file

@ -238,7 +238,6 @@ void PaintSolidBubble(QPainter &p, const SimpleBubble &args) {
auto &corners = (size == Corner::Large) auto &corners = (size == Corner::Large)
? st.msgBgCornersLarge ? st.msgBgCornersLarge
: st.msgBgCornersSmall; : st.msgBgCornersSmall;
const auto &corner = corners.p[index];
p.drawPixmap(x, y, corners.p[index]); p.drawPixmap(x, y, corners.p[index]);
}, [&](const QPoint &bottomPosition) { }, [&](const QPoint &bottomPosition) {
tail.paint(p, bottomPosition - tailShift, args.outerWidth); tail.paint(p, bottomPosition - tailShift, args.outerWidth);
@ -341,15 +340,12 @@ void PaintBubble(QPainter &p, const ComplexBubble &args) {
auto from = top; auto from = top;
for (const auto &selected : args.selection) { for (const auto &selected : args.selection) {
if (selected.top > from) { if (selected.top > from) {
const auto fromTop = (from <= top);
paintOne( paintOne(
QRect(left, from, width, selected.top - from), QRect(left, from, width, selected.top - from),
false, false,
(from <= top), (from <= top),
false); false);
} }
const auto fromTop = (selected.top <= top);
const auto tillBottom = (selected.top + selected.height >= bottom);
paintOne( paintOne(
QRect(left, selected.top, width, selected.height), QRect(left, selected.top, width, selected.height),
true, true,

View file

@ -485,7 +485,6 @@ void Filler::addTogglePin() {
} }
const auto controller = _controller; const auto controller = _controller;
const auto filterId = _request.filterId; const auto filterId = _request.filterId;
const auto peer = _peer;
const auto thread = _request.key.thread(); const auto thread = _request.key.thread();
if (!thread || thread->fixedOnTopIndex()) { if (!thread || thread->fixedOnTopIndex()) {
return; return;
@ -501,7 +500,7 @@ void Filler::addTogglePin() {
TogglePinnedThread(controller, strong, filterId); TogglePinnedThread(controller, strong, filterId);
} }
}; };
const auto pinAction = _addAction( _addAction(
pinText(), pinText(),
pinToggle, pinToggle,
(thread->isPinnedDialog(filterId) (thread->isPinnedDialog(filterId)
@ -1684,25 +1683,21 @@ QPointer<Ui::BoxContent> ShowDropMediaBox(
callback(); callback();
} }
}; };
auto initBox = [](not_null<PeerListBox*> box) { auto initBox = [=](not_null<PeerListBox*> box) {
box->addButton(tr::lng_cancel(), [box] { box->addButton(tr::lng_cancel(), [=] {
box->closeBox(); box->closeBox();
}); });
forum->destroyed(
) | rpl::start_with_next([=] {
box->closeBox();
}, box->lifetime());
}; };
*weak = navigation->parentController()->show(Box<PeerListBox>( *weak = navigation->parentController()->show(Box<PeerListBox>(
std::make_unique<ChooseTopicBoxController>( std::make_unique<ChooseTopicBoxController>(
forum, forum,
std::move(chosen)), std::move(chosen)),
[=](not_null<PeerListBox*> box) { std::move(initBox)));
box->addButton(tr::lng_cancel(), [=] {
box->closeBox();
});
forum->destroyed(
) | rpl::start_with_next([=] {
box->closeBox();
}, box->lifetime());
}));
return weak->data(); return weak->data();
} }

@ -1 +1 @@
Subproject commit 6e923872a4b66767da93f7e388f9fcedf266e1aa Subproject commit 7faff81653264b1cb9cfafeae04cdab82e21117d