Fix -Wunused-variable warnings

This commit is contained in:
Ilya Fedin 2021-07-13 21:51:07 +04:00 committed by John Preston
parent b6881022ce
commit 79cc797aff
156 changed files with 65 additions and 435 deletions

View File

@ -156,7 +156,6 @@ void SendBotCallbackDataWithPassword(
const auto session = &history->session();
const auto owner = &history->owner();
const auto api = &session->api();
const auto bot = item->getMessageBot();
const auto fullId = item->fullId();
const auto getButton = [=] {
return HistoryMessageMarkupButton::Get(

View File

@ -474,7 +474,6 @@ void Updates::differenceDone(const MTPupdates_Difference &result) {
stateDone(d.vstate());
} break;
case mtpc_updates_differenceTooLong: {
auto &d = result.c_updates_differenceTooLong();
LOG(("API Error: updates.differenceTooLong is not supported by Telegram Desktop!"));
} break;
};
@ -1030,9 +1029,6 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
const auto &d = updates.c_updateShortMessage();
const auto flags = mtpCastFlags(d.vflags().v)
| MTPDmessage::Flag::f_from_id;
const auto peerUserId = d.is_out()
? d.vuser_id()
: MTP_int(_session->userId().bare); // #TODO ids
_session->data().addNewMessage(
MTP_message(
MTP_flags(flags),
@ -1250,7 +1246,6 @@ void Updates::applyUpdateNoPtsCheck(const MTPUpdate &update) {
case mtpc_updatePinnedMessages: {
const auto &d = update.c_updatePinnedMessages();
const auto peerId = peerFromMTP(d.vpeer());
for (const auto &msgId : d.vmessages().v) {
const auto item = session().data().message(0, msgId.v);
if (item) {
@ -1607,7 +1602,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
history->setUnreadMark(data.is_unread());
}
}, [&](const MTPDdialogPeerFolder &dialog) {
const auto id = dialog.vfolder_id().v; // #TODO archive
//const auto id = dialog.vfolder_id().v; // #TODO archive
//if (const auto folder = session().data().folderLoaded(id)) {
// folder->setUnreadMark(data.is_unread());
//}
@ -1868,19 +1863,15 @@ void Updates::feedUpdate(const MTPUpdate &update) {
} break;
case mtpc_updateNewEncryptedMessage: {
auto &d = update.c_updateNewEncryptedMessage();
} break;
case mtpc_updateEncryptedChatTyping: {
auto &d = update.c_updateEncryptedChatTyping();
} break;
case mtpc_updateEncryption: {
auto &d = update.c_updateEncryption();
} break;
case mtpc_updateEncryptedMessagesRead: {
auto &d = update.c_updateEncryptedMessagesRead();
} break;
case mtpc_updatePhoneCall:

View File

@ -3874,7 +3874,6 @@ void ApiWrap::forwardMessages(
}
}
const auto newFrom = item->history()->peer;
const auto newGroupId = item->groupId();
if (forwardFrom != newFrom) {
sendAccumulated();
forwardFrom = newFrom;

View File

@ -436,7 +436,6 @@ void Options::Option::updateFieldGeometry() {
const auto skip = st::defaultRadio.diameter
+ st::defaultCheckbox.textPosition.x();
const auto left = anim::interpolate(0, skip, shown);
const auto width = _content->width() - left;
_field->resizeToWidth(_content->width() - left);
_field->moveToLeft(left, 0);
}

View File

@ -1051,10 +1051,8 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
? st::msgFileThumbLayout
: st::msgFileLayout;
const auto w = width() - padding.left() - padding.right();
const auto h = 0 + st.thumbSize + 0;
const auto nameleft = 0 + st.thumbSize + st.padding.right();
const auto nametop = st.nameTop - st.padding.top();
const auto nameright = 0;
const auto statustop = st.statusTop - st.padding.top();
const auto editButton = _isAllowedEditMedia
? _editFile->width() + st::editMediaButtonSkip

View File

@ -216,7 +216,6 @@ std::pair<Languages, Languages> PrepareLists() {
Lang::GetInstance().nativeName()
};
};
const auto i = ranges::find(official, current, projId);
recent.insert(begin(recent), generate());
}
}

View File

@ -516,7 +516,7 @@ void LocalStorageBox::updateMediaLabel() {
}
void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) {
const auto shadow = container->add(
container->add(
object_ptr<Ui::PlainShadow>(container),
st::localStorageRowPadding);

View File

@ -1455,7 +1455,6 @@ void ParticipantsBoxController::rowActionClicked(
base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
QWidget *parent,
not_null<PeerListRow*> row) {
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel();
const auto participant = row->peer();
const auto user = participant->asUser();
@ -1527,8 +1526,6 @@ void ParticipantsBoxController::showAdmin(not_null<UserData*> user) {
user,
currentRights,
_additional.adminRank(user));
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel();
if (_additional.canAddOrEditAdmin(user)) {
const auto done = crl::guard(this, [=](
ChatAdminRightsInfo newRights,
@ -1608,8 +1605,6 @@ void ParticipantsBoxController::showRestricted(not_null<UserData*> user) {
user,
hasAdminRights,
currentRights);
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel();
if (_additional.canRestrictParticipant(user)) {
const auto done = crl::guard(this, [=](
ChatRestrictionsInfo newRights) {

View File

@ -64,8 +64,6 @@ void FillContent(
return;
}
const auto channel = peer->asChannel();
historyVisibility->setValue(savedValue);
const auto result = parent->add(

View File

@ -1313,7 +1313,6 @@ void Controller::saveLinkedChat() {
channel->setLinkedChat(*_savingData.linkedChat);
continueSave();
}).fail([=](const MTP::Error &error) {
const auto &type = error.type();
cancelSave();
}).send();
}
@ -1366,7 +1365,6 @@ void Controller::saveTitle() {
}
void Controller::saveDescription() {
const auto channel = _peer->asChannel();
if (!_savingData.description
|| *_savingData.description == _peer->about()) {
return continueSave();

View File

@ -832,7 +832,6 @@ void CopyInviteLink(const QString &link) {
}
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
const auto session = &peer->session();
const auto sending = std::make_shared<bool>();
const auto box = std::make_shared<QPointer<ShareBox>>();
@ -886,8 +885,6 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
}
const auto owner = &peer->owner();
auto &api = peer->session().api();
auto &histories = owner->histories();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto peer : result) {
const auto history = owner->history(peer);
auto message = ApiWrap::MessageToSend(history);
@ -901,9 +898,6 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
(*box)->closeBox();
}
};
auto filterCallback = [](PeerData *peer) {
return peer->canWrite();
};
*box = Ui::show(
Box<ShareBox>(ShareBox::Descriptor{
.session = &peer->session(),

View File

@ -33,7 +33,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
constexpr auto kPreloadPages = 2;
constexpr auto kFullArcLength = 360 * 16;
enum class Color {

View File

@ -533,7 +533,7 @@ Fn<int()> EditPeerPermissionsBox::addSlowmodeSlider(
return has ? aboutInterval : about;
});
const auto about = container->add(
container->add(
object_ptr<Ui::DividerLabel>(
container,
object_ptr<Ui::FlatLabel>(

View File

@ -539,7 +539,6 @@ void SendFilesBox::pushBlock(int from, int till) {
return controller->isGifPausedAtLeastFor(
Window::GifPauseReason::Layer);
};
const auto index = int(_blocks.size());
_blocks.emplace_back(
_inner.data(),
&_list.files,

View File

@ -1113,7 +1113,6 @@ QString AppendShareGameScoreUrl(
? session->data().channelLoaded(fullId.channel)
: static_cast<ChannelData*>(nullptr);
auto channelAccessHash = uint64(channel ? channel->access : 0);
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
shareHashDataInts[0] = session->userId().bare;
shareHashDataInts[1] = fullId.channel.bare;
shareHashDataInts[2] = fullId.msg;

View File

@ -688,8 +688,6 @@ void StickerSetBox::Inner::paintEvent(QPaintEvent *e) {
return;
}
int32 rows = (_elements.size() / kStickersPanelPerRow)
+ ((_elements.size() % kStickersPanelPerRow) ? 1 : 0);
int32 from = qFloor(e->rect().top() / st::stickersSize.height()), to = qFloor(e->rect().bottom() / st::stickersSize.height()) + 1;
_pathGradient->startFrame(0, width(), width() / 2);

View File

@ -1702,7 +1702,6 @@ void StickersBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
_installSetCallback(_rows[_actionDown]->set->id);
}
} else if (_dragging >= 0) {
QPoint local(mapFromGlobal(_mouse));
_rows[_dragging]->yadd.start(0.);
_aboveShadowFadeStart = _shiftingStartTimes[_dragging] = crl::now();
_aboveShadowFadeOpacity = anim::value(aboveShadowOpacity(), 0);

View File

@ -48,7 +48,6 @@ enum class BarState {
namespace {
constexpr auto kMaxUsersInBar = 3;
constexpr auto kUpdateDebugTimeoutMs = crl::time(500);
constexpr auto kSwitchStateDuration = 120;

View File

@ -31,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Calls::Group {
namespace {
constexpr auto kDefaultScheduleDuration = 60 * TimeId(60);
constexpr auto kLabelRefreshInterval = 10 * crl::time(1000);
using Context = ChooseJoinAsProcess::Context;

View File

@ -1502,7 +1502,6 @@ void GroupCall::applyParticipantLocally(
? participant->canSelfUnmute
: (!mute || IsGroupCallAdmin(_peer, participantPeer));
const auto isMutedByYou = mute && !canManageCall;
const auto mutedCount = 0/*participant->mutedCount*/;
using Flag = MTPDgroupCallParticipant::Flag;
const auto flags = (canSelfUnmute ? Flag::f_can_self_unmute : Flag(0))
| Flag::f_volume // Without flag the volume is reset to 100%.
@ -2018,7 +2017,6 @@ void GroupCall::setupOutgoingVideo() {
// Recursive entrance may happen if error happens when activating.
return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) {
const auto wasPaused = (previous == VideoState::Paused);
const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive);
@ -2073,7 +2071,6 @@ void GroupCall::setupOutgoingVideo() {
// Recursive entrance may happen if error happens when activating.
return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) {
const auto wasPaused = (previous == VideoState::Paused);
const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive);
@ -2372,8 +2369,6 @@ void GroupCall::broadcastPartCancel(not_null<LoadPartTask*> task) {
void GroupCall::mediaChannelDescriptionsStart(
std::shared_ptr<MediaChannelDescriptionsTask> task) {
const auto raw = task.get();
const auto real = lookupReal();
if (!real || (_instanceMode == InstanceMode::None)) {
for (const auto ssrc : task->ssrcs()) {
@ -2398,7 +2393,6 @@ bool GroupCall::mediaChannelDescriptionsFill(
auto result = false;
const auto real = lookupReal();
Assert(real != nullptr);
const auto &existing = real->participants();
for (const auto ssrc : task->ssrcs()) {
const auto add = [&](
std::optional<Channel> channel,
@ -2833,8 +2827,6 @@ void GroupCall::setScreenInstanceConnected(
: inTransit
? InstanceState::TransitionToRtc
: InstanceState::Connected;
const auto connected = (screenInstanceState
!= InstanceState::Disconnected);
if (_screenInstanceState.current() == screenInstanceState) {
return;
}
@ -3078,11 +3070,6 @@ std::variant<int, not_null<UserData*>> GroupCall::inviteUsers(
return 0;
}
const auto owner = &_peer->owner();
const auto &invited = owner->invitedToCallUsers(_id);
auto &&toInvite = users | ranges::views::filter([&](
not_null<UserData*> user) {
return !invited.contains(user) && !real->participantByPeer(user);
});
auto count = 0;
auto slice = QVector<MTPInputUser>();

View File

@ -41,7 +41,6 @@ namespace Calls::Group {
namespace {
constexpr auto kKeepRaisedHandStatusDuration = 3 * crl::time(1000);
constexpr auto kShadowMaxAlpha = 74;
constexpr auto kUserpicSizeForBlur = 40;
constexpr auto kUserpicBlurRadius = 8;
@ -496,7 +495,6 @@ void Members::Controller::subscribeToChanges(not_null<Data::GroupCall*> real) {
: update.now->peer;
if (!update.now) {
if (const auto row = findRow(participantPeer)) {
const auto owner = &participantPeer->owner();
if (isMe(participantPeer)) {
updateRow(row, nullptr);
} else {
@ -779,7 +777,6 @@ void Members::Controller::updateRow(
const Data::GroupCallParticipant *participant) {
const auto wasSounding = row->sounding();
const auto wasSsrc = row->ssrc();
const auto wasInChat = (row->state() != Row::State::Invited);
row->setSkipLevelUpdate(_skipRowLevelUpdate);
row->updateState(participant);
const auto nowSounding = row->sounding();

View File

@ -423,7 +423,6 @@ void RecordingAction::prepare(rpl::producer<QString> text) {
std::move(text) | rpl::start_with_next([=](QString text) {
const auto &padding = _st.itemPadding;
_text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions);
const auto textWidth = _text.maxWidth();
_textWidth = w - padding.left() - padding.right();
update();
}, lifetime());

View File

@ -498,7 +498,6 @@ void Panel::refreshLeftButton() {
}
void Panel::refreshVideoButtons(std::optional<bool> overrideWideMode) {
const auto real = _call->lookupReal();
const auto create = overrideWideMode.value_or(mode() == PanelMode::Wide)
|| (!_call->scheduleDate() && _call->videoIsWorking());
const auto created = _video && _screenShare;
@ -1104,9 +1103,7 @@ void Panel::refreshTopButton() {
updateButtonsGeometry(); // _wideMenu <-> _settings
return;
}
const auto real = _call->lookupReal();
const auto hasJoinAs = _call->showChooseJoinAs();
const auto wide = (_mode.current() == PanelMode::Wide);
const auto showNarrowMenu = _call->canManage()
|| _call->videoIsWorking();
const auto showNarrowUserpic = !showNarrowMenu && hasJoinAs;
@ -2146,9 +2143,6 @@ void Panel::refreshTitle() {
_subtitle->setAttribute(Qt::WA_TransparentForMouseEvents);
}
if (_subtitle) {
const auto middle = _title
? (_title->x() + _title->width() / 2)
: (widget()->width() / 2);
const auto top = _title
? st::groupCallSubtitleTop
: st::groupCallTitleTop;
@ -2163,8 +2157,6 @@ void Panel::refreshTitleGeometry() {
return;
}
const auto fullRect = computeTitleRect();
const auto recordingWidth = 2 * st::groupCallRecordingMarkSkip
+ st::groupCallRecordingMark;
const auto titleRect = _recordingMark
? QRect(
fullRect.x(),

View File

@ -53,7 +53,10 @@ namespace Calls::Group {
namespace {
constexpr auto kDelaysCount = 201;
#ifdef Q_OS_MAC
constexpr auto kCheckAccessibilityInterval = crl::time(500);
#endif // Q_OS_MAC
void SaveCallJoinMuted(
not_null<PeerData*> peer,
@ -96,7 +99,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
const QString &linkSpeaker,
const QString &linkListener,
Fn<void(QString)> showToast) {
const auto session = &peer->session();
const auto sending = std::make_shared<bool>();
const auto box = std::make_shared<QPointer<ShareBox>>();
@ -167,8 +169,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
}
const auto owner = &peer->owner();
auto &api = peer->session().api();
auto &histories = owner->histories();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto peer : result) {
const auto history = owner->history(peer);
auto message = ApiWrap::MessageToSend(history);

View File

@ -352,7 +352,6 @@ Viewport::Layout Viewport::applyLarge(Layout layout) const {
const auto largeTop = largeRect.y();
const auto largeRight = largeLeft + largeRect.width();
const auto largeBottom = largeTop + largeRect.height();
const auto largeCenter = largeRect.center();
for (auto &geometry : list) {
if (geometry.tile == _large) {
geometry.*field = { QPoint(), layout.outer };

View File

@ -282,8 +282,6 @@ vec4 background() {
const auto scaled = InterpolateScaledSize(unscaled, size, expandRatio);
const auto left = (size.width() - scaled.width()) / 2;
const auto top = (size.height() - scaled.height()) / 2;
const auto right = left + scaled.width();
const auto bottom = top + scaled.height();
auto dleft = float(left) / scaled.width();
auto dright = float(size.width() - left) / scaled.width();
auto dtop = float(top) / scaled.height();
@ -511,7 +509,6 @@ void Viewport::RendererGL::paintTile(
const auto fullNameShift = st.namePosition.y() + st::normalFont->height;
const auto nameShift = anim::interpolate(fullNameShift, 0, shown);
const auto row = tile->row();
const auto style = row->computeIconState(MembersRowStyle::Video);
validateOutlineAnimation(tile, tileData);
validatePausedAnimation(tile, tileData);
@ -1336,7 +1333,6 @@ void Viewport::RendererGL::validateDatas() {
}
for (const auto &request : requests) {
const auto i = request.index;
const auto index = _tileDataIndices[i];
const auto &data = _tileData[_tileDataIndices[i]];
if (data.nameRect.isEmpty()) {
continue;

View File

@ -75,10 +75,6 @@ MenuVolumeItem::MenuVolumeItem(
_speakerRect = QRect(_itemRect.topLeft(), _stCross.icon.size());
_arcPosition = _speakerRect.center()
+ QPoint(0, st::groupCallMenuSpeakerArcsSkip);
const auto sliderLeft = _arcPosition.x()
+ st::groupCallMenuVolumeSkip
+ _arcs->maxWidth()
+ st::groupCallMenuVolumeSkip;
_slider->setGeometry(
st::groupCallMenuVolumeMargin.left(),
_speakerRect.y(),

View File

@ -1296,7 +1296,6 @@ void FieldAutocomplete::Inner::selectByMouse(QPoint globalPosition) {
int32 sel = -1, maxSel = 0;
if (!_srows->empty()) {
int32 rows = rowscount(_srows->size(), _stickersPerRow);
int32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1;
int32 col = (mouse.x() >= st::stickerPanPadding) ? ((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) : -1;
if (row >= 0 && col >= 0) {

View File

@ -919,7 +919,7 @@ bool GifsListWidget::refreshInlineRows(int32 *added) {
int32 GifsListWidget::showInlineRows(bool newResults) {
auto added = 0;
auto clear = !refreshInlineRows(&added);
refreshInlineRows(&added);
if (newResults) {
scrollTo(0);
}

View File

@ -1,5 +1,4 @@
/*
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.

View File

@ -48,7 +48,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace ChatHelpers {
namespace {
constexpr auto kInlineItemsMaxPerRow = 5;
constexpr auto kSearchRequestDelay = 400;
constexpr auto kRecentDisplayLimit = 20;
constexpr auto kPreloadOfficialPages = 4;
@ -356,7 +355,6 @@ void StickersListWidget::Footer::returnFocus() {
void StickersListWidget::Footer::enumerateVisibleIcons(
Fn<void(const StickerIcon &, int)> callback) {
auto iconsX = qRound(_iconsX.current());
auto index = iconsX / st::stickerIconWidth;
auto x = _iconsLeft - (iconsX % st::stickerIconWidth);
auto first = floorclamp(iconsX, st::stickerIconWidth, 0, _icons.size());
auto last = ceilclamp(
@ -1708,7 +1706,6 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) {
paintMegagroupEmptySet(p, info.rowsTop, buttonSelected);
return true;
}
auto special = (set.flags & SetFlag::Official) != 0;
auto fromRow = floorclamp(clip.y() - info.rowsTop, _singleSize.height(), 0, info.rowsCount);
auto toRow = ceilclamp(clip.y() + clip.height() - info.rowsTop, _singleSize.height(), 0, info.rowsCount);
for (int i = fromRow; i < toRow; ++i) {
@ -1867,7 +1864,6 @@ void StickersListWidget::ensureLottiePlayer(Set &set) {
raw->updates(
) | rpl::start_with_next([=] {
const auto &sets = shownSets();
enumerateSections([&](const SectionInfo &info) {
if (shownSets()[info.section].lottiePlayer.get() == raw) {
update(
@ -2879,7 +2875,6 @@ void StickersListWidget::updateSelected() {
newSelected = OverGroupAdd {};
}
} else {
auto special = ((set.flags & SetFlag::Official) != 0);
auto rowIndex = qFloor(yOffset / _singleSize.height());
auto columnIndex = qFloor(sx / _singleSize.width());
auto index = rowIndex * _columnCount + columnIndex;

View File

@ -161,7 +161,6 @@ void TabbedPanel::updateContentHeight() {
return;
}
auto was = _contentHeight;
_contentHeight = contentHeight;
resize(QRect(0, 0, innerRect().width(), _contentHeight).marginsAdded(innerPadding()).size());

View File

@ -130,8 +130,6 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
_frameAlpha = anim::interpolate(1, 256, opacity);
auto frameInts = _frameInts + _innerLeft + _innerTop * _frameIntsPerLine;
auto leftToRight = (_direction == Direction::LeftToRight);
auto easeOut = anim::easeOutCirc(1., dt);
@ -241,7 +239,7 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
}
// Debug
//frameInts = _frameInts;
//auto frameInts = _frameInts;
//auto pattern = anim::shifted((static_cast<uint32>(0xFF) << 24) | (static_cast<uint32>(0xFF) << 16) | (static_cast<uint32>(0xFF) << 8) | static_cast<uint32>(0xFF));
//for (auto y = 0; y != _finalHeight; ++y) {
// for (auto x = 0; x != _finalWidth; ++x) {
@ -938,7 +936,6 @@ void TabbedSelector::switchTab() {
}
const auto wasSectionIcons = hasSectionIcons();
const auto wasTab = _currentTabType;
const auto wasIndex = indexByType(_currentTabType);
currentTab()->saveScrollTop();
@ -1154,7 +1151,6 @@ int TabbedSelector::Inner::resizeGetHeight(int newWidth) {
}
int TabbedSelector::Inner::minimalHeight() const {
auto result = _minimalHeight;
return (_minimalHeight > 0)
? _minimalHeight
: (st::emojiPanMaxHeight - st::emojiFooterHeight);

View File

@ -283,7 +283,6 @@ bool Should(
if (document->sticker()) {
return true;
}
const auto size = document->size;
return Should(data, Source::User, document)
|| Should(data, Source::Group, document)
|| Should(data, Source::Channel, document);

View File

@ -528,10 +528,6 @@ bool GroupCall::requestParticipantsAfterReload(
void GroupCall::applyParticipantsSlice(
const QVector<MTPGroupCallParticipant> &list,
ApplySliceSource sliceSource) {
const auto amInCall = inCall();
const auto now = base::unixtime::now();
const auto speakingAfterActive = TimeId(kSpeakingAfterActive / 1000);
for (const auto &participant : list) {
participant.match([&](const MTPDgroupCallParticipant &data) {
const auto participantPeerId = peerFromMTP(data.vpeer());
@ -568,10 +564,6 @@ void GroupCall::applyParticipantsSlice(
|| data.is_can_self_unmute();
const auto lastActive = data.vactive_date().value_or(
was ? was->lastActive : 0);
const auto speaking = canSelfUnmute
&& ((was ? was->speaking : false)
|| (!amInCall
&& (lastActive + speakingAfterActive > now)));
const auto volume = (was
&& !was->applyVolumeFromMin
&& data.is_min())

View File

@ -268,7 +268,6 @@ bool MessagesList::empty() const {
rpl::producer<MessagesResult> MessagesList::viewer(
MessagesQuery &&query) const {
auto copy = query;
return rpl::single(
queryCurrent(query)
) | rpl::then(sliceUpdated() | rpl::map([=] {

View File

@ -13,7 +13,6 @@ namespace Data {
namespace {
MTPinputPeerNotifySettings DefaultSettings() {
const auto flags = MTPDpeerNotifySettings::Flag::f_show_previews;
return MTP_inputPeerNotifySettings(
MTP_flags(0),
MTPBool(),

View File

@ -68,7 +68,6 @@ namespace Data {
namespace {
constexpr auto kMaxNotifyCheckDelay = 24 * 3600 * crl::time(1000);
constexpr auto kMaxWallpaperSize = 10 * 1024 * 1024;
using ViewElement = HistoryView::Element;
@ -183,7 +182,6 @@ std::vector<UnavailableReason> ExtractUnavailableReasons(
[[nodiscard]] std::optional<MTPVideoSize> FindDocumentVideoThumbnail(
const MTPDdocument &data) {
const auto area = [](const MTPVideoSize &size) {
static constexpr auto kInvalid = 0;
return size.match([](const MTPDvideoSize &data) {
return (data.vw().v * data.vh().v);
});
@ -1044,7 +1042,6 @@ void Session::registerSendAction(
if (sendAction->updateNeedsAnimating(user, action)) {
user->madeAction(when);
const auto i = _sendActions.find(std::pair{ history, rootId });
if (!_sendActions.contains(std::pair{ history, rootId })) {
_sendActions.emplace(std::pair{ history, rootId }, crl::now());
_sendActionsAnimation.start();
@ -2575,7 +2572,6 @@ void Session::photoApplyFields(
const MTPDphoto &data) {
const auto &sizes = data.vsizes().v;
const auto progressive = [&] {
const auto kInvalidIndex = sizes.size();
const auto area = [&](const MTPPhotoSize &size) {
return size.match([](const MTPDphotoSizeProgressive &data) {
return data.vw().v * data.vh().v;
@ -4062,7 +4058,6 @@ void Session::insertCheckedServiceNotification(
const TextWithEntities &message,
const MTPMessageMedia &media,
TimeId date) {
const auto history = this->history(PeerData::kServiceNotificationsId);
const auto flags = MTPDmessage::Flag::f_entities
| MTPDmessage::Flag::f_from_id
| MTPDmessage::Flag::f_media;

View File

@ -22,11 +22,8 @@ constexpr auto kDocumentCacheMask = 0x00000000000000FFULL;
constexpr auto kDocumentThumbCacheTag = 0x0000000000000200ULL;
constexpr auto kDocumentThumbCacheMask = 0x00000000000000FFULL;
constexpr auto kWebDocumentCacheTag = 0x0000020000000000ULL;
constexpr auto kWebDocumentCacheMask = 0x000000FFFFFFFFFFULL;
constexpr auto kUrlCacheTag = 0x0000030000000000ULL;
constexpr auto kUrlCacheMask = 0x000000FFFFFFFFFFULL;
constexpr auto kGeoPointCacheTag = 0x0000040000000000ULL;
constexpr auto kGeoPointCacheMask = 0x000000FFFFFFFFFFULL;
} // namespace

View File

@ -1344,7 +1344,6 @@ StickersSet *Stickers::feedSetFull(const MTPmessages_StickerSet &data) {
}
void Stickers::newSetReceived(const MTPmessages_StickerSet &data) {
bool writeArchived = false;
const auto &set = data.c_messages_stickerSet();
const auto &s = set.vset().c_stickerSet();
if (!s.vinstalled_date()) {

View File

@ -697,10 +697,6 @@ void InnerWidget::paintCollapsedRow(
bool selected) const {
Expects(row->folder != nullptr);
const auto smallWidth = st::dialogsPadding.x()
+ st::dialogsPhotoSize
+ st::dialogsPhotoPadding;
const auto narrow = (width() <= smallWidth);
const auto text = row->folder->chatListName();
const auto unread = row->folder->chatListUnreadCount();
Layout::PaintCollapsedRow(
@ -2584,7 +2580,7 @@ void InnerWidget::loadPeerPhotos() {
int32 from = (yFrom - filteredOffset()) / st::dialogsRowHeight;
if (from < 0) from = 0;
if (from < _filterResults.size()) {
int32 to = (yTo / int32(st::dialogsRowHeight)) + 1, w = width();
int32 to = (yTo / int32(st::dialogsRowHeight)) + 1;
if (to > _filterResults.size()) to = _filterResults.size();
for (; from < to; ++from) {
@ -2595,7 +2591,7 @@ void InnerWidget::loadPeerPhotos() {
from = (yFrom > filteredOffset() + st::searchedBarHeight ? ((yFrom - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size();
if (from < 0) from = 0;
if (from < _peerSearchResults.size()) {
int32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1, w = width();
int32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1;
if (to > _peerSearchResults.size()) to = _peerSearchResults.size();
for (; from < to; ++from) {
@ -2605,7 +2601,7 @@ void InnerWidget::loadPeerPhotos() {
from = (yFrom > filteredOffset() + ((_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight) ? ((yFrom - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size();
if (from < 0) from = 0;
if (from < _searchResults.size()) {
int32 to = (yTo > filteredOffset() + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight ? ((yTo - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size() + 1, w = width();
int32 to = (yTo > filteredOffset() + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight ? ((yTo - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size() + 1;
if (to > _searchResults.size()) to = _searchResults.size();
for (; from < to; ++from) {
@ -2680,7 +2676,6 @@ bool InnerWidget::chooseHashtag() {
}
ChosenRow InnerWidget::computeChosenRow() const {
auto msgId = ShowAtUnreadMsgId;
if (_state == WidgetState::Default) {
if (_selected) {
return {
@ -2747,7 +2742,6 @@ RowDescriptor InnerWidget::chatListEntryBefore(
}
const auto whichHistory = which.key.history();
const auto whichFullId = which.fullId;
if (!whichHistory) {
return RowDescriptor();
}
@ -2825,7 +2819,6 @@ RowDescriptor InnerWidget::chatListEntryAfter(
}
const auto whichHistory = which.key.history();
const auto whichFullId = which.fullId;
if (!whichHistory) {
return RowDescriptor();
}

View File

@ -700,7 +700,6 @@ void Widget::startSlideAnimation() {
_folderTopBar->hide();
}
int delta = st::slideShift;
if (_showDirection == Window::SlideDirection::FromLeft) {
std::swap(_cacheUnder, _cacheOver);
}

View File

@ -269,7 +269,6 @@ void ColorPicker::paintOutline(Painter &p, const QRectF &rect) {
return;
}
const auto draw = [&](float opacity) {
const auto was = p.opacity();
p.save();
p.setOpacity(opacity);
p.setPen(Qt::lightGray);

View File

@ -399,7 +399,6 @@ void PhotoEditorControls::showAnimated(
const auto duration = st::photoEditorBarAnimationDuration;
const auto isTransform = (mode == Mode::Transform);
const auto isPaint = (mode == Mode::Paint);
const auto buttonsLeft = (width() - _transformButtons->width()) / 2;
const auto buttonsTop = bottomButtonsTop();

View File

@ -29,8 +29,6 @@ namespace Export {
namespace Data {
namespace {
constexpr auto kUserPeerIdShift = (1ULL << 32);
constexpr auto kChatPeerIdShift = (2ULL << 32);
constexpr auto kMaxImageSize = 10000;
constexpr auto kMigratedMessagesIdShift = -1'000'000'000;
@ -546,7 +544,6 @@ Poll ParsePoll(const MTPDmessageMediaPoll &data) {
if (const auto resultsList = results.vresults()) {
for (const auto &single : resultsList->v) {
single.match([&](const MTPDpollAnswerVoters &voters) {
const auto &option = voters.voption().v;
const auto i = ranges::find(
result.answers,
voters.voption().v,

View File

@ -24,7 +24,7 @@ namespace {
constexpr auto kUserpicsSliceLimit = 100;
constexpr auto kFileChunkSize = 128 * 1024;
constexpr auto kFileRequestsCount = 2;
constexpr auto kFileNextRequestDelay = crl::time(20);
//constexpr auto kFileNextRequestDelay = crl::time(20);
constexpr auto kChatsSliceLimit = 100;
constexpr auto kMessagesSliceLimit = 100;
constexpr auto kTopPeerSliceLimit = 100;
@ -251,7 +251,7 @@ auto ApiWrap::RequestBuilder<Request>::done(
FnMut<void()> &&handler
) -> RequestBuilder& {
if (handler) {
auto &silence_warning = _builder.done(std::move(handler));
[[maybe_unused]] auto &silence_warning = _builder.done(std::move(handler));
}
return *this;
}
@ -261,7 +261,7 @@ auto ApiWrap::RequestBuilder<Request>::done(
FnMut<void(Response &&)> &&handler
) -> RequestBuilder& {
if (handler) {
auto &silence_warning = _builder.done(std::move(handler));
[[maybe_unused]] auto &silence_warning = _builder.done(std::move(handler));
}
return *this;
}
@ -271,7 +271,7 @@ auto ApiWrap::RequestBuilder<Request>::fail(
Fn<bool(const MTP::Error &)> &&handler
) -> RequestBuilder& {
if (handler) {
auto &silence_warning = _builder.fail([
[[maybe_unused]] auto &silence_warning = _builder.fail([
common = base::take(_commonFailHandler),
specific = std::move(handler)
](const MTP::Error &error) {

View File

@ -2656,7 +2656,6 @@ Result HtmlWriter::writeSections() {
}
QByteArray HtmlWriter::wrapMessageLink(int messageId, QByteArray text) {
const auto finishedCount = _lastMessageIdsPerFile.size();
const auto it = ranges::find_if(_lastMessageIdsPerFile, [&](int maxMessageId) {
return messageId <= maxMessageId;
});

View File

@ -41,7 +41,6 @@ Content ContentFromState(
return;
}
const auto substepsTotal = state.substepsTotal;
const auto step = static_cast<int>(state.step);
const auto done = state.substepsPassed;
const auto add = state.substepsNow;
const auto doneProgress = done / float64(substepsTotal);

View File

@ -64,7 +64,7 @@ void ChooseFormatBox(
using Format = Output::Format;
const auto group = std::make_shared<Ui::RadioenumGroup<Format>>(format);
const auto addFormatOption = [&](QString label, Format format) {
const auto radio = box->addRow(
box->addRow(
object_ptr<Ui::Radioenum<Format>>(
box,
group,
@ -261,7 +261,7 @@ void SettingsWidget::setupPathAndFormat(
});
});
const auto addFormatOption = [&](QString label, Format format) {
const auto radio = container->add(
container->add(
object_ptr<Ui::Radioenum<Format>>(
container,
formatGroup,
@ -582,7 +582,7 @@ not_null<Ui::Checkbox*> SettingsWidget::addOptionWithAbout(
Types types,
const QString &about) {
const auto result = addOption(container, text, types);
const auto label = container->add(
container->add(
object_ptr<Ui::FlatLabel>(
container,
about,

View File

@ -919,7 +919,6 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
? _selectedText
: TextSelection();
view->draw(p, clip.translated(0, -top), selection, ms);
const auto item = view->data();
auto height = view->height();
top += height;
p.translate(0, height);
@ -1024,7 +1023,6 @@ auto InnerWidget::viewForItem(const HistoryItem *item) -> Element* {
}
void InnerWidget::paintEmpty(Painter &p) {
style::font font(st::msgServiceFont);
auto rectWidth = st::historyAdminLogEmptyWidth;
auto innerWidth = rectWidth - st::historyAdminLogEmptyPadding.left() - st::historyAdminLogEmptyPadding.right();
auto rectHeight = st::historyAdminLogEmptyPadding.top() + _emptyText.countHeight(innerWidth) + st::historyAdminLogEmptyPadding.bottom();
@ -1734,7 +1732,7 @@ void InnerWidget::updateSelected() {
void InnerWidget::performDrag() {
if (_mouseAction != MouseAction::Dragging) return;
auto uponSelected = false;
//auto uponSelected = false;
//if (_mouseActionItem) {
// if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) {
// uponSelected = _selected.contains(_mouseActionItem);

View File

@ -880,7 +880,6 @@ void GenerateItems(
auto createChangeLinkedChat = [&](const MTPDchannelAdminLogEventActionChangeLinkedChat &action) {
const auto broadcast = channel->isBroadcast();
const auto was = history->owner().channelLoaded(action.vprev_value().v);
const auto now = history->owner().channelLoaded(action.vnew_value().v);
if (!now) {
auto text = (broadcast

View File

@ -54,7 +54,6 @@ namespace {
constexpr auto kNewBlockEachMessage = 50;
constexpr auto kSkipCloudDraftsFor = TimeId(2);
constexpr auto kSendingDraftTime = TimeId(-1);
using UpdateFlag = Data::HistoryUpdate::Flag;
@ -1223,7 +1222,7 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
}
void History::addNewerSlice(const QVector<MTPMessage> &slice) {
bool wasEmpty = isEmpty(), wasLoadedAtBottom = loadedAtBottom();
bool wasLoadedAtBottom = loadedAtBottom();
if (slice.isEmpty()) {
_loadedAtBottom = true;
@ -1758,7 +1757,6 @@ void History::setFolderPointer(Data::Folder *folder) {
if (isPinnedDialog(FilterId())) {
owner().setChatPinned(this, FilterId(), false);
}
auto &filters = owner().chatsFilters();
const auto wasKnown = folderKnown();
const auto wasInList = inChatList();
if (wasInList) {
@ -2045,7 +2043,6 @@ void History::finishBuildingFrontBlock() {
if (const auto block = base::take(_buildingFrontBlock)->block) {
if (blocks.size() > 1) {
// ... item, item, item, last ], [ first, item, item ...
const auto last = block->messages.back().get();
const auto first = blocks[1]->messages.front().get();
// we've added a new front block, so previous item for

View File

@ -901,7 +901,6 @@ void HistoryInner::touchDeaccelerate(int32 elapsed) {
}
void HistoryInner::touchEvent(QTouchEvent *e) {
const Qt::TouchPointStates &states(e->touchPointStates());
if (e->type() == QEvent::TouchCancel) { // cancel
if (!_touchInProgress) return;
_touchInProgress = false;
@ -2105,7 +2104,6 @@ void HistoryInner::checkHistoryActivation() {
auto block = _history->blocks[_curBlock].get();
auto view = block->messages[_curItem].get();
while (_curBlock > 0 || _curItem > 0) {
const auto top = itemTop(view);
const auto bottom = itemTop(view) + view->height();
if (_visibleAreaBottom >= bottom) {
break;

View File

@ -531,7 +531,6 @@ void ReplyKeyboard::updateMessageId() {
void ReplyKeyboard::resize(int width, int height) {
_width = width;
auto markup = _item->Get<HistoryMessageReplyMarkup>();
auto y = 0.;
auto buttonHeight = _rows.empty()
? float64(_st->buttonHeight())

View File

@ -154,7 +154,6 @@ constexpr auto kFullDayInMs = 86400 * 1000;
constexpr auto kSaveDraftTimeout = 1000;
constexpr auto kSaveDraftAnywayTimeout = 5000;
constexpr auto kSaveCloudDraftIdleTimeout = 14000;
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kRefreshSlowmodeLabelTimeout = crl::time(200);
constexpr auto kCommonModifiers = 0
| Qt::ShiftModifier
@ -2576,12 +2575,10 @@ void HistoryWidget::messagesReceived(PeerData *peer, const MTPmessages_Messages
}
if (_preloadRequest == requestId) {
auto to = toMigrated ? _migrated : _history;
addMessagesToFront(peer, *histList);
_preloadRequest = 0;
preloadHistoryIfNeeded();
} else if (_preloadDownRequest == requestId) {
auto to = toMigrated ? _migrated : _history;
addMessagesToBack(peer, *histList);
_preloadDownRequest = 0;
preloadHistoryIfNeeded();
@ -3370,7 +3367,6 @@ PeerData *HistoryWidget::peer() const {
// Sometimes _showAtMsgId is set directly.
void HistoryWidget::setMsgId(MsgId showAtMsgId) {
if (_showAtMsgId != showAtMsgId) {
auto wasMsgId = _showAtMsgId;
_showAtMsgId = showAtMsgId;
if (_history) {
controller()->setActiveChatEntry({
@ -5644,7 +5640,6 @@ void HistoryWidget::setupGroupCallTracker() {
_groupCallBar->joinClicks()
) | rpl::start_with_next([=] {
const auto peer = _history->peer;
const auto channel = peer->asChannel();
if (peer->groupCall()) {
controller()->startOrJoinGroupCall(peer);
}

View File

@ -58,7 +58,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace HistoryView {
namespace {
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kSaveDraftTimeout = crl::time(1000);
constexpr auto kSaveDraftAnywayTimeout = 5 * crl::time(1000);
constexpr auto kMouseEvents = {

View File

@ -43,8 +43,6 @@ using SendActionUpdate = VoiceRecordBar::SendActionUpdate;
using VoiceToSend = VoiceRecordBar::VoiceToSend;
constexpr auto kAudioVoiceUpdateView = crl::time(200);
constexpr auto kLockDelay = crl::time(100);
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kAudioVoiceMaxLength = 100 * 60; // 100 minutes
constexpr auto kMaxSamples =
::Media::Player::kDefaultFrequency * kAudioVoiceMaxLength;

View File

@ -58,8 +58,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace HistoryView {
namespace {
// If we can't cloud-export link for such time we export it locally.
constexpr auto kExportLocalTimeout = crl::time(1000);
constexpr auto kRescheduleLimit = 20;
MsgId ItemIdAcrossData(not_null<HistoryItem*> item) {
@ -772,7 +770,6 @@ void AddReportAction(
return;
}
const auto owner = &item->history()->owner();
const auto asGroup = (request.pointState != PointState::GroupPart);
const auto controller = list->controller();
const auto itemId = item->fullId();
const auto callback = crl::guard(controller, [=] {
@ -898,7 +895,6 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
const auto rawLink = link.get();
const auto linkPhoto = dynamic_cast<PhotoClickHandler*>(rawLink);
const auto linkDocument = dynamic_cast<DocumentClickHandler*>(rawLink);
const auto linkPeer = dynamic_cast<PeerClickHandler*>(rawLink);
const auto photo = linkPhoto ? linkPhoto->photo().get() : nullptr;
const auto document = linkDocument
? linkDocument->document().get()

View File

@ -274,7 +274,6 @@ void UnreadBar::paint(Painter &p, int y, int w, bool chatWide) const {
p.setFont(st::historyUnreadBarFont);
p.setPen(st::historyUnreadBarFg);
int left = st::msgServiceMargin.left();
int maxwidth = w;
if (chatWide) {
maxwidth = qMin(

View File

@ -2378,7 +2378,6 @@ void ListWidget::mouseActionUpdate() {
if (dateTop <= point.y()) {
auto opacity = (dateInPlace/* || noFloatingDate*/) ? 1. : scrollDateOpacity;
if (opacity > 0.) {
const auto item = view->data();
auto dateWidth = 0;
if (const auto date = view->Get<HistoryView::DateBadge>()) {
dateWidth = date->width;
@ -2427,7 +2426,6 @@ void ListWidget::mouseActionUpdate() {
const auto message = view->data()->toHistoryMessage();
Assert(message != nullptr);
const auto from = message->displayFrom();
dragState = TextState(nullptr, view->fromPhotoLink());
_overItemExact = session().data().message(dragState.itemId);
lnkhost = view;
@ -2449,7 +2447,6 @@ void ListWidget::mouseActionUpdate() {
Ui::Tooltip::Show(1000, this);
}
auto cursor = style::cur_default;
if (_mouseAction == MouseAction::None) {
_mouseCursorState = dragState.cursor;
auto cursor = computeMouseCursor();

View File

@ -385,7 +385,6 @@ QSize Message::performCountOptimalSize() {
const auto reply = displayedReply();
const auto via = item->Get<HistoryMessageVia>();
const auto entry = logEntryOriginal();
const auto views = item->Get<HistoryMessageViews>();
if (forwarded) {
forwarded->create(via);
}
@ -955,7 +954,6 @@ void Message::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const
const auto forwarded = item->Get<HistoryMessageForwarded>();
const auto &serviceFont = st::msgServiceFont;
const auto &serviceName = st::msgServiceNameFont;
const auto skip1 = forwarded->psaType.isEmpty()
? 0
: st::historyPsaIconSkip1;
@ -1023,7 +1021,6 @@ void Message::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const
}
void Message::paintReplyInfo(Painter &p, QRect &trect, bool selected) const {
const auto item = message();
if (auto reply = displayedReply()) {
int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
@ -1081,7 +1078,6 @@ PointState Message::pointState(QPoint point) const {
// Entry page is always a bubble bottom.
auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || (entry/* && entry->isBubbleBottom()*/);
auto mediaOnTop = (mediaDisplayed && media->isBubbleTop()) || (entry && entry->isBubbleTop());
if (item->repliesAreComments() || item->externalReply()) {
g.setHeight(g.height() - st::historyCommentsButtonHeight);
@ -1564,7 +1560,6 @@ bool Message::getStateReplyInfo(
QPoint point,
QRect &trect,
not_null<TextState*> outResult) const {
const auto item = message();
if (auto reply = displayedReply()) {
int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
if (point.y() >= trect.top() && point.y() < trect.top() + h) {
@ -1629,7 +1624,6 @@ void Message::updatePressed(QPoint point) {
if (drawBubble()) {
auto mediaDisplayed = media && media->isDisplayed();
auto top = marginTop();
auto trect = g.marginsAdded(-st::msgPadding);
if (mediaDisplayed && media->isBubbleTop()) {
trect.setY(trect.y() - st::msgPadding.top());
@ -1656,7 +1650,6 @@ void Message::updatePressed(QPoint point) {
trect.setHeight(trect.height() + st::msgPadding.bottom());
}
auto needDateCheck = true;
if (mediaDisplayed) {
auto mediaHeight = media->height();
auto mediaLeft = trect.x() - st::msgPadding.left();
@ -2506,7 +2499,6 @@ TextSelection Message::unskipTextSelection(TextSelection selection) const {
QRect Message::countGeometry() const {
const auto commentsRoot = (context() == Context::Replies)
&& data()->isDiscussionPost();
const auto item = message();
const auto media = this->media();
const auto mediaWidth = (media && media->isDisplayed())
? media->width()
@ -2658,9 +2650,6 @@ int Message::resizeContentGetHeight(int newWidth) {
const auto skip1 = forwarded->psaType.isEmpty()
? 0
: st::historyPsaIconSkip1;
const auto skip2 = forwarded->psaType.isEmpty()
? 0
: st::historyPsaIconSkip2;
const auto fwdheight = ((forwarded->text.maxWidth() > (contentWidth - st::msgPadding.left() - st::msgPadding.right() - skip1)) ? 2 : 1) * st::semiboldFont->height;
newHeight += fwdheight;
}
@ -2697,7 +2686,6 @@ bool Message::hasVisibleText() const {
}
QSize Message::performCountCurrentSize(int newWidth) {
const auto item = message();
const auto newHeight = resizeContentGetHeight(newWidth);
return { newWidth, newHeight };

View File

@ -544,7 +544,6 @@ rpl::producer<Data::MessagesSlice> PinnedWidget::listSource(
Data::MessagePosition aroundId,
int limitBefore,
int limitAfter) {
const auto channelId = peerToChannel(_history->peer->id);
const auto messageId = aroundId.fullId.msg
? aroundId.fullId.msg
: (ServerMaxMsgId - 1);

View File

@ -115,7 +115,6 @@ void PinnedTracker::refreshCurrentFromSlice() {
const auto i = _migratedPeer
? ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj1)
: ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj2);
const auto empty = _slice.ids.empty();
const auto before = int(i - begin(_slice.ids));
const auto after = int(end(_slice.ids) - i);
const auto haveValidData = (before > 0 || _slice.skippedBefore == 0)

View File

@ -634,7 +634,6 @@ bool RepliesWidget::confirmSendingFiles(
Api::SendType::Normal,
SendMenu::Type::SilentOnly); // #TODO replies schedule
const auto replyTo = replyToId();
box->setConfirmedCallback(crl::guard(this, [=](
Ui::PreparedList &&list,
Ui::SendFilesWay way,

View File

@ -581,7 +581,6 @@ void Service::draw(
}
PointState Service::pointState(QPoint point) const {
const auto item = message();
const auto media = this->media();
auto g = countGeometry();
@ -705,7 +704,6 @@ void EmptyPainter::paint(Painter &p, int width, int height) {
)->maxWidth();
const auto &font = st::serviceTextStyle.font;
const auto margin = st::msgMargin.left();
const auto maxBubbleWidth = width - 2 * st::historyGroupAboutMargin;
const auto padding = st::historyGroupAboutPadding;
const auto bubbleWidth = std::min(

View File

@ -15,7 +15,6 @@ namespace HistoryView {
WebPageText TitleAndDescriptionFromWebPage(not_null<WebPageData*> d) {
QString resultTitle, resultDescription;
const auto document = d->document;
const auto photo = d->photo;
const auto author = d->author;
const auto siteName = d->siteName;
const auto title = d->title;

View File

@ -74,7 +74,7 @@ QSize Call::countOptimalSize() {
void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto paintw = width();
auto outbg = _parent->hasOutLayout();
auto selected = (selection == FullSelection);
@ -89,8 +89,6 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m
nameright = st::msgFileLayout.padding.left();
statustop = st::historyCallStatusTop - topMinus;
auto namewidth = paintw - nameleft - nameright;
p.setFont(st::semiboldFont);
p.setPen(outbg ? (selected ? st::historyFileNameOutFgSelected : st::historyFileNameOutFg) : (selected ? st::historyFileNameInFgSelected : st::historyFileNameInFg));
p.drawTextLeft(nameleft, nametop, paintw, _text);

View File

@ -150,7 +150,7 @@ QSize Contact::countOptimalSize() {
void Contact::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto paintw = width();
auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection);

View File

@ -152,7 +152,6 @@ Document::Document(
not_null<DocumentData*> document)
: File(parent, realParent)
, _data(document) {
const auto item = parent->data();
auto caption = createCaption();
createComponents(!caption.isEmpty());
@ -703,7 +702,6 @@ TextState Document::textState(
StateRequest request,
LayoutMode mode) const {
const auto width = layout.width();
const auto height = layout.height();
auto result = TextState(_parent);
@ -714,7 +712,7 @@ TextState Document::textState(
ensureDataMediaCreated();
bool loaded = dataLoaded();
bool showPause = updateStatusText();
updateStatusText();
const auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
const auto thumbed = Get<HistoryDocumentThumbed>();
@ -724,7 +722,6 @@ TextState Document::textState(
const auto nameleft = st.padding.left() + st.thumbSize + st.padding.right();
const auto nametop = st.nameTop - topMinus;
const auto nameright = st.padding.left();
const auto statustop = st.statusTop - topMinus;
const auto linktop = st.linkTop - topMinus;
const auto bottom = st.padding.top() + st.thumbSize + st.padding.bottom() - topMinus;
const auto rthumb = style::rtlrect(st.padding.left(), st.padding.top() - topMinus, st.thumbSize, st.thumbSize, width);
@ -841,7 +838,6 @@ bool Document::hasTextForCopy() const {
TextForMimeData Document::selectedText(TextSelection selection) const {
if (const auto captioned = Get<HistoryDocumentCaptioned>()) {
const auto &caption = captioned->_caption;
return captioned->_caption.toTextForMimeData(selection);
}
return TextForMimeData();

View File

@ -90,7 +90,6 @@ QSize Game::countOptimalSize() {
}
// init dimensions
auto l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth;
auto minHeight = 0;
@ -201,14 +200,13 @@ TextSelection Game::fromDescriptionSelection(
void Game::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintw = width(), painth = height();
auto paintw = width();
auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();
@ -277,7 +275,7 @@ TextState Game::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result;
}
auto paintw = width(), painth = height();
auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();

View File

@ -715,7 +715,6 @@ TextState Gif::cornerStatusTextState(
return result;
}
const auto padding = st::msgDateImgPadding;
const auto addWidth = st::historyVideoDownloadSize + 2 * padding.y() - padding.x();
const auto statusX = position.x() + st::msgDateImgDelta + padding.x();
const auto statusY = position.y() + st::msgDateImgDelta + padding.y();
const auto inner = QRect(statusX + padding.y() - padding.x(), statusY, st::historyVideoDownloadSize, st::historyVideoDownloadSize);
@ -928,9 +927,6 @@ void Gif::drawGrouped(
const auto streamingMode = _streamed || autoplay;
const auto activeOwnPlaying = activeOwnStreamed();
auto paintx = geometry.x(), painty = geometry.y(), paintw = geometry.width(), painth = geometry.height();
auto displayMute = false;
const auto streamed = activeOwnPlaying
? &activeOwnPlaying->instance
: nullptr;
@ -1257,9 +1253,7 @@ void Gif::setStatusSize(int newSize) const {
void Gif::updateStatusText() const {
ensureDataMediaCreated();
auto showPause = false;
auto statusSize = 0;
auto realDuration = 0;
if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) {
statusSize = Ui::FileStatusSizeFailed;
} else if (_data->uploading()) {

View File

@ -99,7 +99,6 @@ QSize Invoice::countOptimalSize() {
}
// init dimensions
auto l = st::msgPadding.left(), r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth;
auto minHeight = 0;
@ -202,14 +201,12 @@ void Invoice::refreshParentId(not_null<HistoryItem*> realParent) {
void Invoice::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintw = width(), painth = height();
auto paintw = width();
auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();
@ -252,7 +249,6 @@ void Invoice::draw(Painter &p, const QRect &r, TextSelection selection, crl::tim
p.translate(attachLeft, attachTop);
_attach->draw(p, r.translated(-attachLeft, -attachTop), attachSelection, ms);
auto pixwidth = _attach->width();
auto pixheight = _attach->height();
auto available = _status.maxWidth();
auto statusW = available + 2 * st::msgDateImgPadding.x();
@ -279,7 +275,7 @@ TextState Invoice::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result;
}
auto paintw = width(), painth = height();
auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();

View File

@ -77,7 +77,6 @@ QSize UnwrappedMedia::countCurrentSize(int newWidth) {
const auto item = _parent->data();
accumulate_min(newWidth, maxWidth());
if (_parent->media() == this) {
const auto infoWidth = _parent->infoWidth() + 2 * st::msgDateImgPadding.x();
const auto via = item->Get<HistoryMessageVia>();
const auto reply = _parent->displayedReply();
const auto forwarded = getDisplayedForwardedInfo();

View File

@ -307,9 +307,6 @@ int Poll::countAnswerTop(
}
tshift += _question.countHeight(innerWidth) + st::historyPollSubtitleSkip;
tshift += st::msgDateFont->height + st::historyPollAnswersSkip;
auto &&answers = ranges::views::zip(
_answers,
ranges::views::ints(0, int(_answers.size())));
const auto i = ranges::find(
_answers,
&answer,
@ -338,8 +335,6 @@ int Poll::countAnswerHeight(
}
QSize Poll::countCurrentSize(int newWidth) {
const auto paddings = st::msgPadding.left() + st::msgPadding.right();
accumulate_min(newWidth, maxWidth());
const auto innerWidth = newWidth
- st::msgPadding.left()
@ -722,7 +717,7 @@ void Poll::updateAnswerVotes() {
void Poll::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto paintw = width();
checkSendingAnimation();
_poll->checkResultsReload(_parent->data(), ms);
@ -1173,7 +1168,6 @@ void Poll::paintPercent(
int outerWidth,
TextSelection selection) const {
const auto outbg = _parent->hasOutLayout();
const auto selected = (selection == FullSelection);
const auto aleft = left + st::historyPollAnswerPadding.left();
top += st::historyPollAnswerPadding.top();
@ -1329,9 +1323,6 @@ TextState Poll::textState(QPoint point, StateRequest request) const {
return result;
}
tshift += st::msgDateFont->height + st::historyPollAnswersSkip;
const auto awidth = paintw
- st::historyPollAnswerPadding.left()
- st::historyPollAnswerPadding.right();
for (const auto &answer : _answers) {
const auto height = countAnswerHeight(answer, paintw);
if (point.y() >= tshift && point.y() < tshift + height) {
@ -1384,7 +1375,6 @@ auto Poll::bubbleRoll() const -> BubbleRoll {
if (!_wrongAnswerAnimated) {
return BubbleRoll();
}
const auto rotateFull = value * kRotateSegments;
const auto progress = [](float64 full) {
const auto lower = std::floor(full);
const auto shift = (full - lower);

View File

@ -122,11 +122,8 @@ void ThemeDocument::draw(Painter &p, const QRect &r, TextSelection selection, cr
auto loaded = dataLoaded();
auto displayLoading = _data->displayLoading();
auto inWebPage = (_parent->media() != this);
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto captionw = paintw - st::msgPadding.left() - st::msgPadding.right();
if (displayLoading) {
ensureAnimation();
if (!_animation->radial.animating()) {
@ -270,7 +267,6 @@ TextState ThemeDocument::textState(QPoint point, StateRequest request) const {
return result;
}
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto bubble = _parent->hasBubble();
if (QRect(paintx, painty, paintw, painth).contains(point)) {
if (_data->uploading()) {
result.link = _cancell;

View File

@ -241,7 +241,6 @@ QSize WebPage::countOptimalSize() {
}
// init dimensions
auto l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth;
auto minHeight = 0;
@ -449,14 +448,13 @@ void WebPage::unloadHeavyPart() {
void WebPage::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto paintw = width();
auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();
@ -479,7 +477,6 @@ void WebPage::draw(Painter &p, const QRect &r, TextSelection selection, crl::tim
if (asArticle()) {
ensurePhotoMediaCreated();
const auto contextId = _parent->data()->fullId();
QPixmap pix;
auto pw = qMax(_pixw, lineHeight);
auto ph = _pixh;
@ -599,7 +596,7 @@ TextState WebPage::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result;
}
auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding();

View File

@ -100,7 +100,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento);
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop());
}

View File

@ -401,7 +401,6 @@ void ListWidget::Section::paint(
const Context &context,
QRect clip,
int outerWidth) const {
auto baseIndex = 0;
auto header = headerHeight();
if (QRect(0, 0, outerWidth, header).intersects(clip)) {
p.setPen(st::infoMediaHeaderFg);
@ -412,17 +411,6 @@ void ListWidget::Section::paint(
outerWidth - 2 * st::infoMediaHeaderPosition.x(),
outerWidth);
}
auto top = header + _itemsTop;
auto fromcol = floorclamp(
clip.x() - _itemsLeft,
_itemWidth,
0,
_itemsInRow);
auto tillcol = ceilclamp(
clip.x() + clip.width() - _itemsLeft,
_itemWidth,
0,
_itemsInRow);
auto localContext = context.layoutContext;
localContext.isAfterDate = (header > 0);
@ -718,7 +706,6 @@ void ListWidget::itemRemoved(not_null<const HistoryItem*> item) {
auto sectionIt = findSectionByItem(id);
if (sectionIt != _sections.end()) {
if (sectionIt->removeItem(id)) {
auto top = sectionIt->top();
if (sectionIt->empty()) {
_sections.erase(sectionIt);
}
@ -1852,7 +1839,6 @@ void ListWidget::mouseActionUpdate(const QPoint &globalPosition) {
point - geometry.topLeft(),
inside
};
auto item = layout ? layout->getItem() : nullptr;
if (_overLayout != layout) {
repaintItem(_overLayout);
_overLayout = layout;
@ -1972,7 +1958,6 @@ void ListWidget::updateDragSelection() {
}
for (auto &layoutItem : _layouts) {
auto &&universalId = layoutItem.first;
auto &&layout = layoutItem.second;
if (universalId <= fromId && universalId > tillId) {
changeItemSelection(
_dragSelected,

View File

@ -92,7 +92,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento->state());
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop());
}

View File

@ -668,7 +668,6 @@ int InnerWidget::desiredHeight() const {
}
void InnerWidget::setupContent() {
const auto quiz = _poll->quiz();
_content->add(
object_ptr<Ui::FlatLabel>(
_content,

View File

@ -103,7 +103,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento);
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop());
}

View File

@ -106,7 +106,6 @@ void Widget::saveState(not_null<Memento*> memento) {
}
void Widget::restoreState(not_null<Memento*> memento) {
const auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop());
}

View File

@ -459,7 +459,6 @@ void Sticker::unloadHeavyPart() {
void Sticker::paint(Painter &p, const QRect &clip, const PaintContext *context) const {
ensureDataMediaCreated(getShownDocument());
bool loaded = _dataMedia->loaded();
auto over = _a_over.value(_active ? 1. : 0.);
if (over > 0) {
@ -726,7 +725,6 @@ void Video::initDimensions() {
description = _duration;
}
_description.setText(st::defaultTextStyle, description, descriptionOpts);
int32 descriptionHeight = qMin(_description.countHeight(textWidth), descriptionLines * st::normalFont->height);
_minh = st::inlineThumbSize;
_minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@ -847,7 +845,6 @@ File::File(not_null<Context*> context, not_null<Result*> result)
void File::initDimensions() {
_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
int textWidth = _maxw - (st::inlineFileSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
@ -863,7 +860,6 @@ void File::paint(Painter &p, const QRect &clip, const PaintContext *context) con
const auto left = st::inlineFileSize + st::inlineThumbSkip;
ensureDataMediaCreated();
const auto loaded = _documentMedia->loaded();
const auto displayLoading = _document->displayLoading();
if (displayLoading) {
ensureAnimation();
@ -1083,11 +1079,9 @@ void Contact::initDimensions() {
int32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, textWidth, st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
int32 titleHeight = qMin(_title.countHeight(textWidth), st::semiboldFont->height);
TextParseOptions descriptionOpts = { TextParseMultiline, textWidth, st::normalFont->height, Qt::LayoutDirectionAuto };
_description.setText(st::defaultTextStyle, _result->getLayoutDescription(), descriptionOpts);
int32 descriptionHeight = qMin(_description.countHeight(textWidth), st::normalFont->height);
_minh = st::inlineFileSize;
_minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@ -1348,7 +1342,6 @@ void Game::countFrameSize() {
void Game::initDimensions() {
_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
int32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
int32 titleHeight = qMin(_title.countHeight(_maxw), 2 * st::semiboldFont->height);
@ -1390,7 +1383,7 @@ void Game::paint(Painter &p, const QRect &clip, const PaintContext *context) con
if (animatedThumb) {
_documentMedia->automaticLoad(fileOrigin(), nullptr);
bool loaded = _documentMedia->loaded(), loading = document->loading(), displayLoading = document->displayLoading();
bool loaded = _documentMedia->loaded(), displayLoading = document->displayLoading();
if (loaded && !_gif && !_gif.isBad()) {
auto that = const_cast<Game*>(this);
that->_gif = Media::Clip::MakeReader(

View File

@ -650,7 +650,6 @@ bool Inner::inlineItemVisible(const ItemBase *layout) {
int row = position / MatrixRowShift, col = position % MatrixRowShift;
Assert((row < _rows.size()) && (col < _rows[row].items.size()));
auto &inlineItems = _rows[row].items;
int top = st::stickerPanPadding;
for (int32 i = 0; i < row; ++i) {
top += _rows.at(i).height;
@ -668,7 +667,6 @@ void Inner::updateSelected() {
return;
}
auto newSelected = -1;
auto p = mapFromGlobal(_lastMousePos);
int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::roundRadiusSmall);

View File

@ -173,7 +173,6 @@ QByteArray FileParser::ReadFile(const QString &absolutePath, const QString &rela
file.seek(0);
QByteArray data;
int skip = 0;
auto readUtf16Stream = [relativePath, absolutePath](auto &&stream) {
stream.setCodec("UTF-16");
auto string = stream.readAll();

View File

@ -41,7 +41,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Main {
namespace {
constexpr auto kLegacyCallsPeerToPeerNobody = 4;
constexpr auto kTmpPasswordReserveTime = TimeId(10);
[[nodiscard]] QString ValidatedInternalLinksDomain(

View File

@ -797,10 +797,6 @@ void MainWidget::cacheBackground() {
result.setDevicePixelRatio(cRetinaFactor());
{
QPainter p(&result);
auto left = 0;
auto top = 0;
auto right = _willCacheFor.width();
auto bottom = _willCacheFor.height();
auto w = bg.width() / cRetinaFactor();
auto h = bg.height() / cRetinaFactor();
auto sx = 0;
@ -1691,7 +1687,6 @@ Window::SectionSlideParams MainWidget::prepareThirdSectionAnimation(Window::Sect
result.withTopBarShadow = false;
}
floatPlayerHideAll();
auto sectionTop = getThirdSectionTop();
result.oldContentCache = _thirdSection->grabForShowAnimation(result);
floatPlayerShowVisible();
return result;

View File

@ -1601,7 +1601,6 @@ public:
return false;
}
int res = 0;
char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
for (int32 i = 0, l = fmtContext->nb_streams; i < l; ++i) {

View File

@ -11,13 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/file_location.h"
namespace Media {
namespace {
constexpr AVSampleFormat AudioToFormat = AV_SAMPLE_FMT_S16;
constexpr int64_t AudioToChannelLayout = AV_CH_LAYOUT_STEREO;
constexpr int32 AudioToChannels = 2;
} // namespace
ChildFFMpegLoader::ChildFFMpegLoader(
std::unique_ptr<ExternalSoundData> &&data)

View File

@ -28,7 +28,6 @@ Type ReadBigEndian(bytes::const_span data) {
}
bool IsAtom(bytes::const_span header, const char (&atom)[5]) {
const auto check = header.subspan(4, 4);
return bytes::compare(
header.subspan(4, 4),
bytes::make_span(atom).subspan(0, 4)) == 0;

View File

@ -709,7 +709,6 @@ Manager::ResultHandleState Manager::handleResult(ReaderPrivate *reader, ProcessR
auto it = constUnsafeFindReaderPointer(reader);
if (it != _readerPointers.cend()) {
int32 index = 0;
Reader *r = it.key();
Reader::Frame *frame = it.key()->frameToWrite(&index);
if (frame) {
frame->clear();

View File

@ -628,7 +628,6 @@ void Instance::playPauseCancelClicked(AudioMsgId::Type type) {
return;
}
const auto state = getState(type);
const auto stopped = IsStoppedOrStopping(state.state);
const auto showPause = ShowPauseIcon(state.state);
const auto audio = state.id.audio();
if (audio && audio->loading() && !data->streamed) {

View File

@ -271,10 +271,6 @@ void Widget::handleSeekProgress(float64 progress) {
void Widget::handleSeekFinished(float64 progress) {
if (!_lastDurationMs) return;
const auto positionMs = std::clamp(
static_cast<crl::time>(progress * _lastDurationMs),
crl::time(0),
_lastDurationMs);
_seekPositionMs = -1;
instance()->finishSeeking(_type, progress);
@ -464,7 +460,6 @@ void Widget::handleSongUpdate(const TrackState &state) {
_playbackProgress->updateState(state);
}
auto stopped = IsStoppedOrStopping(state.state);
auto showPause = ShowPauseIcon(state.state);
if (instance()->isSeeking(_type)) {
showPause = true;

View File

@ -14,11 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Media {
namespace Streaming {
namespace {
constexpr auto kMaxConcurrentRequests = 4;
} // namespace
LoaderMtproto::LoaderMtproto(
not_null<Storage::DownloadManagerMtproto*> owner,

View File

@ -25,7 +25,7 @@ constexpr auto kMsFrequency = 1000; // 1000 ms per second.
// If we played for 3 seconds and got stuck it looks like we're loading
// slower than we're playing, so load full file in that case.
constexpr auto kLoadFullIfStuckAfterPlayback = 3 * crl::time(1000);
//constexpr auto kLoadFullIfStuckAfterPlayback = 3 * crl::time(1000);
[[nodiscard]] bool FullTrackReceived(const TrackState &state) {
return (state.duration != kTimeUnknown)
@ -348,8 +348,6 @@ void Player::fileWaitingForData() {
bool Player::fileProcessPackets(
base::flat_map<int, std::vector<FFmpeg::Packet>> &packets) {
_waitingForData = false;
auto audioTill = kTimeUnknown;
auto videoTill = kTimeUnknown;
for (auto &[index, list] : packets) {
if (list.empty()) {
continue;

View File

@ -141,8 +141,8 @@ QImage ConvertFrame(
- storage.width();
const auto deltaFrom = (frame->linesize[0] / sizeof(uint32))
- frame->width;
for (const auto y : ranges::views::ints(0, frame->height)) {
for (const auto x : ranges::views::ints(0, frame->width)) {
for ([[maybe_unused]] const auto y : ranges::views::ints(0, frame->height)) {
for ([[maybe_unused]] const auto x : ranges::views::ints(0, frame->width)) {
// Wipe out possible alpha values.
*to++ = 0xFF000000U | *from++;
}

View File

@ -32,7 +32,6 @@ static_assert(kDisplaySkipped != kTimeUnknown);
//}
auto result = FFmpeg::CreateFrameStorage(data.size);
const auto format = AV_PIX_FMT_BGRA;
const auto swscale = FFmpeg::MakeSwscalePointer(
data.size,
AV_PIX_FMT_YUV420P,

View File

@ -1076,7 +1076,6 @@ void OverlayWidget::resizeContentByScreenSize() {
: (_streamed->controls.y()
- st::mediaviewCaptionPadding.bottom()
- st::mediaviewCaptionMargin.height());
const auto skipWidth = 0;
const auto skipHeight = (height() - bottom);
const auto availableWidth = width();
const auto availableHeight = height() - 2 * skipHeight;
@ -2030,15 +2029,6 @@ bool OverlayWidget::validCollage() const {
if (!_collage) {
return false;
}
const auto countDistanceInData = [](const auto &a, const auto &b) {
return [&](const WebPageCollage &data) {
const auto i = ranges::find(data.items, a);
const auto j = ranges::find(data.items, b);
return (i != end(data.items) && j != end(data.items))
? std::make_optional(i - j)
: std::nullopt;
};
};
if (key == _collage->key) {
return true;
@ -2113,12 +2103,6 @@ void OverlayWidget::refreshCaption(HistoryItem *item) {
if (caption.text.isEmpty()) {
return;
}
const auto asBot = [&] {
if (const auto author = item->author()->asUser()) {
return author->isBot();
}
return false;
}();
using namespace HistoryView;
_caption = Ui::Text::String(st::msgMinWidth);

View File

@ -44,7 +44,6 @@ namespace View {
namespace {
constexpr auto kPipLoaderPriority = 2;
constexpr auto kSaveGeometryTimeout = crl::time(1000);
constexpr auto kMsInSecond = 1000;
[[nodiscard]] bool IsWindowControlsOnLeft() {
@ -1515,7 +1514,7 @@ void Pip::updatePlaybackState() {
}
_playbackProgress->updateState(state);
qint64 position = 0, length = state.length;
qint64 position = 0;
if (Player::IsStoppedAtEnd(state.state)) {
position = state.length;
} else if (!Player::IsStoppedOrStopping(state.state)) {

View File

@ -205,7 +205,6 @@ void Pip::RendererSW::paintTransformedImage(
const auto rect = geometry.inner;
const auto rotation = geometry.rotation;
if (geometry.useTransparency) {
const auto sides = RectPart::AllSides & ~geometry.attached;
Ui::Shadow::paint(*_p, rect, geometry.outer.width(), st::callShadow);
}

Some files were not shown because too many files have changed in this diff Show More