Version 4.15.1: Fix build with GCC.

This commit is contained in:
John Preston 2024-03-08 15:49:30 +04:00
parent 3d5092f7ad
commit 990ae11f62
10 changed files with 3 additions and 59 deletions

View file

@ -425,14 +425,9 @@ Ui::BoostCounters ParseBoostCounters(
}
Ui::BoostFeatures LookupBoostFeatures(not_null<ChannelData*> channel) {
const auto group = channel->isMegagroup();
const auto appConfig = &channel->session().account().appConfig();
const auto get = [&](const QString &key, int fallback, bool ok = true) {
return ok ? appConfig->get<int>(key, fallback) : 0;
};
auto nameColorsByLevel = base::flat_map<int, int>();
auto linkStylesByLevel = base::flat_map<int, int>();
const auto group = channel->isMegagroup();
const auto peerColors = &channel->session().api().peerColors();
const auto &list = group
? peerColors->requiredLevelsGroup()

View file

@ -262,7 +262,6 @@ void ShortcutMessages::scheduleShortcutsReload() {
}
void ShortcutMessages::apply(const MTPDupdateNewQuickReply &update) {
const auto selfId = _session->userPeerId();
const auto &reply = update.vquick_reply();
auto foundId = BusinessShortcutId();
const auto shortcut = parseShortcut(reply);

View file

@ -244,10 +244,8 @@ void Contact::draw(Painter &p, const PaintContext &context) const {
}
const auto st = context.st;
const auto sti = context.imageStyle();
const auto stm = context.messageStyle();
const auto bubble = st::msgPadding;
const auto full = Rect(currentSize());
const auto outer = full - inBubblePadding();
const auto inner = outer - innerMargin();
@ -438,7 +436,6 @@ TextState Contact::textState(QPoint point, StateRequest request) const {
if (_buttons.size() > 1) {
const auto end = rect::bottom(inner) + _st.padding.bottom();
const auto line = st::historyPageButtonLine;
const auto bWidth = inner.width() / float64(_buttons.size());
const auto bHeight = rect::bottom(outer) - end;
for (auto i = 0; i < _buttons.size(); i++) {

View file

@ -167,12 +167,7 @@ Ui::RpWidget *ContentWidget::doSetInnerWidget(
const auto bottom = top + height;
_innerDesiredHeight = desired;
_innerWrap->setVisibleTopBottom(top, bottom);
LOG(("TOP: %1, HEIGHT: %2, DESIRED: %3, TILL: %4").arg(top).arg(height).arg(desired).arg(std::max(desired - bottom, 0)));
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
//const auto bottom = _scroll->scrollTop() + _scroll->height();
//_innerDesiredHeight = desired;
//_innerWrap->setVisibleTopBottom(_scroll->scrollTop(), bottom);
//_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
}, _innerWrap->lifetime());
return _innerWrap->entity();

View file

@ -138,7 +138,6 @@ void LayerWidget::setContentHeight(int height) {
if (_contentWrapHeight == height) {
return;
}
LOG(("CONTENT WRAP HEIGHT: %1 -> %2").arg(_contentWrapHeight).arg(height));
_contentWrapHeight = height;
if (_inResize) {
_pendingResize = true;
@ -261,35 +260,6 @@ int LayerWidget::resizeGetHeight(int newWidth) {
auto attempts = 0;
while (true) {
_inResize = true;
{
const auto &parentSize = parentWidget()->size();
const auto windowWidth = parentSize.width();
const auto windowHeight = parentSize.height();
const auto newLeft = (windowWidth - newWidth) / 2;
const auto newTop = std::clamp(
windowHeight / 24,
st::infoLayerTopMinimal,
st::infoLayerTopMaximal);
const auto newBottom = newTop;
const auto bottomRadius = st::boxRadius;
const auto maxVisibleHeight = windowHeight - newTop;
// Top rounding is included in _contentWrapHeight.
auto desiredHeight = _contentWrapHeight + bottomRadius;
accumulate_min(desiredHeight, maxVisibleHeight - newBottom);
// First resize content to new width and get the new desired height.
const auto contentLeft = 0;
const auto contentTop = 0;
const auto contentBottom = bottomRadius;
const auto contentWidth = newWidth;
auto contentHeight = desiredHeight - contentTop - contentBottom;
LOG(("ATTEMPT %1: WIDTH %2, WRAP HEIGHT %3, SCROLL TILL BOTTOM: %4"
).arg(attempts + 1
).arg(newWidth
).arg(_contentWrapHeight
).arg(_contentWrap->scrollTillBottom(contentHeight)));
}
const auto newGeometry = countGeometry(newWidth);
_inResize = false;
if (!_pendingResize) {

View file

@ -479,7 +479,6 @@ void Chatbots::setupContent(
void Chatbots::save() {
const auto show = controller()->uiShow();
const auto session = &controller()->session();
const auto fail = [=](QString error) {
if (error == u"BUSINESS_RECIPIENTS_EMPTY"_q) {
show->showToast(tr::lng_greeting_recipients_empty(tr::now));

View file

@ -130,7 +130,6 @@ void QuickReplies::setupContent(
auto old = inner->count();
const auto &shortcuts = messages->shortcuts();
auto i = 0;
for (const auto &[_, shortcut]
: shortcuts.list | ranges::views::reverse) {
if (!shortcut.count) {

View file

@ -171,7 +171,7 @@ void AddBusinessRecipientsSelector(
const auto all = current.allButExcluded || current.included.empty();
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
all ? kAllExcept : kSelectedOnly);
const auto everyone = container->add(
container->add(
object_ptr<Ui::Radiobutton>(
container,
group,
@ -179,7 +179,7 @@ void AddBusinessRecipientsSelector(
tr::lng_chatbots_all_except(tr::now),
st::settingsChatbotsAccess),
st::settingsChatbotsAccessMargins);
const auto selected = container->add(
container->add(
object_ptr<Ui::Radiobutton>(
container,
group,

View file

@ -181,7 +181,6 @@ private:
void processScroll();
void updateInnerVisibleArea();
void pushReplyReturn(not_null<HistoryItem*> item);
void checkReplyReturns();
void confirmDeleteSelected();
void clearSelected();
@ -565,7 +564,6 @@ bool ShortcutMessages::paintOuter(
not_null<QWidget*> outer,
int maxVisibleHeight,
QRect clip) {
const auto window = outer->window()->height();
Window::SectionWidget::PaintBackground(
_theme.get(),
outer,
@ -1092,12 +1090,6 @@ bool ShortcutMessages::cornerButtonsHas(CornerButtonType type) {
return (type == CornerButtonType::Down);
}
void ShortcutMessages::pushReplyReturn(not_null<HistoryItem*> item) {
if (item->shortcutId() == _shortcutId.current()) {
_cornerButtons.pushReplyReturn(item);
}
}
void ShortcutMessages::checkReplyReturns() {
const auto currentTop = _scroll->scrollTop();
const auto shortcutId = _shortcutId.current();

View file

@ -60,7 +60,6 @@ private:
const auto abs = std::abs(data.utcOffset);
const auto hours = abs / 3600;
const auto minutes = (abs % 3600) / 60;
const auto seconds = abs % 60;
const auto sign = (data.utcOffset < 0) ? '-' : '+';
const auto prefix = u"(UTC"_q
+ sign
@ -366,7 +365,6 @@ void EditDayBox(
const auto from = std::max(
std::min(last + 30 * 60, kDay - 30 * 60),
last + 60);
const auto till = std::min(from + 4 * 3600, kDay + 30 * 60);
now.list.push_back({ from, from + 4 * 3600 });
}
state->data = std::move(now);