diff --git a/Telegram/SourceFiles/api/api_bot.cpp b/Telegram/SourceFiles/api/api_bot.cpp index 516f37227..7d424e6b1 100644 --- a/Telegram/SourceFiles/api/api_bot.cpp +++ b/Telegram/SourceFiles/api/api_bot.cpp @@ -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( diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index da5d254f3..5d3f45fba 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -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: diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 35622b30b..549749af3 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3874,7 +3874,6 @@ void ApiWrap::forwardMessages( } } const auto newFrom = item->history()->peer; - const auto newGroupId = item->groupId(); if (forwardFrom != newFrom) { sendAccumulated(); forwardFrom = newFrom; diff --git a/Telegram/SourceFiles/boxes/create_poll_box.cpp b/Telegram/SourceFiles/boxes/create_poll_box.cpp index 82e37f248..12804aabe 100644 --- a/Telegram/SourceFiles/boxes/create_poll_box.cpp +++ b/Telegram/SourceFiles/boxes/create_poll_box.cpp @@ -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); } diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index ce1396823..24949d74a 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -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 diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index e7917c763..a14dbeb5f 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -216,7 +216,6 @@ std::pair PrepareLists() { Lang::GetInstance().nativeName() }; }; - const auto i = ranges::find(official, current, projId); recent.insert(begin(recent), generate()); } } diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 82fafb972..b70e9c3b6 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -516,7 +516,7 @@ void LocalStorageBox::updateMediaLabel() { } void LocalStorageBox::setupLimits(not_null container) { - const auto shadow = container->add( + container->add( object_ptr(container), st::localStorageRowPadding); diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index 840512e28..7c4b41c5e 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -1455,7 +1455,6 @@ void ParticipantsBoxController::rowActionClicked( base::unique_qptr ParticipantsBoxController::rowContextMenu( QWidget *parent, not_null 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 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 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) { diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_history_visibility_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_history_visibility_box.cpp index fbf4de9bf..075356335 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_history_visibility_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_history_visibility_box.cpp @@ -64,8 +64,6 @@ void FillContent( return; } - const auto channel = peer->asChannel(); - historyVisibility->setValue(savedValue); const auto result = parent->add( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index aa36a08e7..286512410 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -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(); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp index 001c62434..f0b529815 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp @@ -832,7 +832,6 @@ void CopyInviteLink(const QString &link) { } void ShareInviteLinkBox(not_null peer, const QString &link) { - const auto session = &peer->session(); const auto sending = std::make_shared(); const auto box = std::make_shared>(); @@ -886,8 +885,6 @@ void ShareInviteLinkBox(not_null 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 peer, const QString &link) { (*box)->closeBox(); } }; - auto filterCallback = [](PeerData *peer) { - return peer->canWrite(); - }; *box = Ui::show( Box(ShareBox::Descriptor{ .session = &peer->session(), diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp index 093c5c5ba..b28428d9f 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp @@ -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 { diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp index ca3670d8a..2d4b67ee2 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp @@ -533,7 +533,7 @@ Fn EditPeerPermissionsBox::addSlowmodeSlider( return has ? aboutInterval : about; }); - const auto about = container->add( + container->add( object_ptr( container, object_ptr( diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index b43c3a7bf..5007b911a 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -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, diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 0d5791e9d..8c6cb34b8 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1113,7 +1113,6 @@ QString AppendShareGameScoreUrl( ? session->data().channelLoaded(fullId.channel) : static_cast(nullptr); auto channelAccessHash = uint64(channel ? channel->access : 0); - auto channelAccessHashInts = reinterpret_cast(&channelAccessHash); shareHashDataInts[0] = session->userId().bare; shareHashDataInts[1] = fullId.channel.bare; shareHashDataInts[2] = fullId.msg; diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index cf2f3eeb4..fdf774d42 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -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); diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index 1d1330381..21b7547e6 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -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); diff --git a/Telegram/SourceFiles/calls/calls_top_bar.cpp b/Telegram/SourceFiles/calls/calls_top_bar.cpp index 99c3ea21b..451ddf1a8 100644 --- a/Telegram/SourceFiles/calls/calls_top_bar.cpp +++ b/Telegram/SourceFiles/calls/calls_top_bar.cpp @@ -48,7 +48,6 @@ enum class BarState { namespace { -constexpr auto kMaxUsersInBar = 3; constexpr auto kUpdateDebugTimeoutMs = crl::time(500); constexpr auto kSwitchStateDuration = 120; diff --git a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp index 5f7bec0e3..db1e6a3bb 100644 --- a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp +++ b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp @@ -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; diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index 71508fa7d..e35e39fad 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -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 task) { void GroupCall::mediaChannelDescriptionsStart( std::shared_ptr 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, @@ -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> GroupCall::inviteUsers( return 0; } const auto owner = &_peer->owner(); - const auto &invited = owner->invitedToCallUsers(_id); - auto &&toInvite = users | ranges::views::filter([&]( - not_null user) { - return !invited.contains(user) && !real->participantByPeer(user); - }); auto count = 0; auto slice = QVector(); diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index c4e430ca4..1d6aa524f 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -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 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(); diff --git a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp index a57a1b3cb..b523cc233 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_menu.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_menu.cpp @@ -423,7 +423,6 @@ void RecordingAction::prepare(rpl::producer 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()); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index d864f2724..022b0f299 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -498,7 +498,6 @@ void Panel::refreshLeftButton() { } void Panel::refreshVideoButtons(std::optional 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(), diff --git a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp index 66087e309..19f3f37bb 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp @@ -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 peer, @@ -96,7 +99,6 @@ object_ptr ShareInviteLinkBox( const QString &linkSpeaker, const QString &linkListener, Fn showToast) { - const auto session = &peer->session(); const auto sending = std::make_shared(); const auto box = std::make_shared>(); @@ -167,8 +169,6 @@ object_ptr 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); diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport.cpp b/Telegram/SourceFiles/calls/group/calls_group_viewport.cpp index c14aa0d77..e8f9cad8b 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport.cpp @@ -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 }; diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp index b75f7a199..72ee3914e 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport_opengl.cpp @@ -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; diff --git a/Telegram/SourceFiles/calls/group/calls_volume_item.cpp b/Telegram/SourceFiles/calls/group/calls_volume_item.cpp index 979beb6a4..d143a66a6 100644 --- a/Telegram/SourceFiles/calls/group/calls_volume_item.cpp +++ b/Telegram/SourceFiles/calls/group/calls_volume_item.cpp @@ -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(), diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index f14d6aaad..464a73298 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -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) { diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index abfde7084..fa8c42294 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -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); } diff --git a/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.h b/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.h index e8752b84f..53564363a 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.h +++ b/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.h @@ -1,5 +1,4 @@ /* -/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index d551cc37d..a9eb774b5 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -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 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; diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp index 189c8ec18..f39f357c4 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp @@ -161,7 +161,6 @@ void TabbedPanel::updateContentHeight() { return; } - auto was = _contentHeight; _contentHeight = contentHeight; resize(QRect(0, 0, innerRect().width(), _contentHeight).marginsAdded(innerPadding()).size()); diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp index 2b1b84056..f5ebc830d 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp @@ -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(0xFF) << 24) | (static_cast(0xFF) << 16) | (static_cast(0xFF) << 8) | static_cast(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); diff --git a/Telegram/SourceFiles/data/data_auto_download.cpp b/Telegram/SourceFiles/data/data_auto_download.cpp index 3e6ad0f13..ff9420ee8 100644 --- a/Telegram/SourceFiles/data/data_auto_download.cpp +++ b/Telegram/SourceFiles/data/data_auto_download.cpp @@ -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); diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index 8fd732dc9..116388d79 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -528,10 +528,6 @@ bool GroupCall::requestParticipantsAfterReload( void GroupCall::applyParticipantsSlice( const QVector &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()) diff --git a/Telegram/SourceFiles/data/data_messages.cpp b/Telegram/SourceFiles/data/data_messages.cpp index 6e312cbd9..9d01a067d 100644 --- a/Telegram/SourceFiles/data/data_messages.cpp +++ b/Telegram/SourceFiles/data/data_messages.cpp @@ -268,7 +268,6 @@ bool MessagesList::empty() const { rpl::producer MessagesList::viewer( MessagesQuery &&query) const { - auto copy = query; return rpl::single( queryCurrent(query) ) | rpl::then(sliceUpdated() | rpl::map([=] { diff --git a/Telegram/SourceFiles/data/data_notify_settings.cpp b/Telegram/SourceFiles/data/data_notify_settings.cpp index 83228e7eb..d234af1df 100644 --- a/Telegram/SourceFiles/data/data_notify_settings.cpp +++ b/Telegram/SourceFiles/data/data_notify_settings.cpp @@ -13,7 +13,6 @@ namespace Data { namespace { MTPinputPeerNotifySettings DefaultSettings() { - const auto flags = MTPDpeerNotifySettings::Flag::f_show_previews; return MTP_inputPeerNotifySettings( MTP_flags(0), MTPBool(), diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 749c821a6..5b50e62de 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -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 ExtractUnavailableReasons( [[nodiscard]] std::optional 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; diff --git a/Telegram/SourceFiles/data/data_types.cpp b/Telegram/SourceFiles/data/data_types.cpp index 6f3a86532..38c109e12 100644 --- a/Telegram/SourceFiles/data/data_types.cpp +++ b/Telegram/SourceFiles/data/data_types.cpp @@ -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 diff --git a/Telegram/SourceFiles/data/stickers/data_stickers.cpp b/Telegram/SourceFiles/data/stickers/data_stickers.cpp index c71ff6f34..0917335b9 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers.cpp @@ -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()) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 21556455a..fad66090a 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -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(); } diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 93502d652..6cefdb93e 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -700,7 +700,6 @@ void Widget::startSlideAnimation() { _folderTopBar->hide(); } - int delta = st::slideShift; if (_showDirection == Window::SlideDirection::FromLeft) { std::swap(_cacheUnder, _cacheOver); } diff --git a/Telegram/SourceFiles/editor/color_picker.cpp b/Telegram/SourceFiles/editor/color_picker.cpp index 0342085fd..8d68a12d9 100644 --- a/Telegram/SourceFiles/editor/color_picker.cpp +++ b/Telegram/SourceFiles/editor/color_picker.cpp @@ -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); diff --git a/Telegram/SourceFiles/editor/photo_editor_controls.cpp b/Telegram/SourceFiles/editor/photo_editor_controls.cpp index a82d92d4b..e5ed2def4 100644 --- a/Telegram/SourceFiles/editor/photo_editor_controls.cpp +++ b/Telegram/SourceFiles/editor/photo_editor_controls.cpp @@ -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(); diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index b61cc1820..b2f45cf7c 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -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, diff --git a/Telegram/SourceFiles/export/export_api_wrap.cpp b/Telegram/SourceFiles/export/export_api_wrap.cpp index eb8353d6a..efddc6d9c 100644 --- a/Telegram/SourceFiles/export/export_api_wrap.cpp +++ b/Telegram/SourceFiles/export/export_api_wrap.cpp @@ -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::done( FnMut &&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::done( FnMut &&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::fail( Fn &&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) { diff --git a/Telegram/SourceFiles/export/output/export_output_html.cpp b/Telegram/SourceFiles/export/output/export_output_html.cpp index 16c9c0d3a..fc6638394 100644 --- a/Telegram/SourceFiles/export/output/export_output_html.cpp +++ b/Telegram/SourceFiles/export/output/export_output_html.cpp @@ -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; }); diff --git a/Telegram/SourceFiles/export/view/export_view_content.cpp b/Telegram/SourceFiles/export/view/export_view_content.cpp index 2d3812525..fac8b3d76 100644 --- a/Telegram/SourceFiles/export/view/export_view_content.cpp +++ b/Telegram/SourceFiles/export/view/export_view_content.cpp @@ -41,7 +41,6 @@ Content ContentFromState( return; } const auto substepsTotal = state.substepsTotal; - const auto step = static_cast(state.step); const auto done = state.substepsPassed; const auto add = state.substepsNow; const auto doneProgress = done / float64(substepsTotal); diff --git a/Telegram/SourceFiles/export/view/export_view_settings.cpp b/Telegram/SourceFiles/export/view/export_view_settings.cpp index 956cfb780..7febd9d95 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.cpp +++ b/Telegram/SourceFiles/export/view/export_view_settings.cpp @@ -64,7 +64,7 @@ void ChooseFormatBox( using Format = Output::Format; const auto group = std::make_shared>(format); const auto addFormatOption = [&](QString label, Format format) { - const auto radio = box->addRow( + box->addRow( object_ptr>( 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>( container, formatGroup, @@ -582,7 +582,7 @@ not_null SettingsWidget::addOptionWithAbout( Types types, const QString &about) { const auto result = addOption(container, text, types); - const auto label = container->add( + container->add( object_ptr( container, about, diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 046c4a144..40a454332 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -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); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index 7e17645fd..0f49b7e6b 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -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 diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 1564394e4..e5028c1db 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -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 &slice) { } void History::addNewerSlice(const QVector &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 diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 101122bc0..11eae477d 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -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; diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 243edb69f..0e758b4f8 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -531,7 +531,6 @@ void ReplyKeyboard::updateMessageId() { void ReplyKeyboard::resize(int width, int height) { _width = width; - auto markup = _item->Get(); auto y = 0.; auto buttonHeight = _rows.empty() ? float64(_st->buttonHeight()) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 796ca7563..700275756 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -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); } diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 76e14e5de..9ca0f951d 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -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 = { diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 594b00082..b82a46edf 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -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; diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 8dfdc0afb..ff3c5d221 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -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 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 FillContextMenu( const auto rawLink = link.get(); const auto linkPhoto = dynamic_cast(rawLink); const auto linkDocument = dynamic_cast(rawLink); - const auto linkPeer = dynamic_cast(rawLink); const auto photo = linkPhoto ? linkPhoto->photo().get() : nullptr; const auto document = linkDocument ? linkDocument->document().get() diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp index 8e6d804b3..0b1614e6d 100644 --- a/Telegram/SourceFiles/history/view/history_view_element.cpp +++ b/Telegram/SourceFiles/history/view/history_view_element.cpp @@ -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( diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 8ca77a1da..33f979bdd 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -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()) { 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(); diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index d334ea25f..e9e3990ee 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -385,7 +385,6 @@ QSize Message::performCountOptimalSize() { const auto reply = displayedReply(); const auto via = item->Get(); const auto entry = logEntryOriginal(); - const auto views = item->Get(); if (forwarded) { forwarded->create(via); } @@ -955,7 +954,6 @@ void Message::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const const auto forwarded = item->Get(); 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 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 }; diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp index d5a2fc370..d2d70c890 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp @@ -544,7 +544,6 @@ rpl::producer 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); diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_tracker.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_tracker.cpp index be5963df5..8e31bac8d 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_tracker.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_tracker.cpp @@ -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) diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index f618163c8..377b3df98 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -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, diff --git a/Telegram/SourceFiles/history/view/history_view_service_message.cpp b/Telegram/SourceFiles/history/view/history_view_service_message.cpp index 8b73e2703..d513e30bd 100644 --- a/Telegram/SourceFiles/history/view/history_view_service_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_service_message.cpp @@ -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( diff --git a/Telegram/SourceFiles/history/view/history_view_webpage_preview.cpp b/Telegram/SourceFiles/history/view/history_view_webpage_preview.cpp index 7ea777d79..d7d5398c9 100644 --- a/Telegram/SourceFiles/history/view/history_view_webpage_preview.cpp +++ b/Telegram/SourceFiles/history/view/history_view_webpage_preview.cpp @@ -15,7 +15,6 @@ namespace HistoryView { WebPageText TitleAndDescriptionFromWebPage(not_null 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; diff --git a/Telegram/SourceFiles/history/view/media/history_view_call.cpp b/Telegram/SourceFiles/history/view/media/history_view_call.cpp index aa2881aeb..3722a015d 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_call.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_call.cpp @@ -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); diff --git a/Telegram/SourceFiles/history/view/media/history_view_contact.cpp b/Telegram/SourceFiles/history/view/media/history_view_contact.cpp index cdbfbaf6e..dc2ee677a 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_contact.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_contact.cpp @@ -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); diff --git a/Telegram/SourceFiles/history/view/media/history_view_document.cpp b/Telegram/SourceFiles/history/view/media/history_view_document.cpp index 2a5be9ee1..3c8595354 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_document.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_document.cpp @@ -152,7 +152,6 @@ Document::Document( not_null 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(); @@ -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()) { - const auto &caption = captioned->_caption; return captioned->_caption.toTextForMimeData(selection); } return TextForMimeData(); diff --git a/Telegram/SourceFiles/history/view/media/history_view_game.cpp b/Telegram/SourceFiles/history/view/media/history_view_game.cpp index cda894a14..e881ca698 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_game.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_game.cpp @@ -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 ®ular = 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(); diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index 63a393235..24d519a57 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -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()) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp b/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp index dbd40997b..45261fe6e 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp @@ -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 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 ®ular = 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(); diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp index 34767914d..6fc3f4727 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp @@ -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(); const auto reply = _parent->displayedReply(); const auto forwarded = getDisplayedForwardedInfo(); diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index 58a82deec..ac1ff6a9b 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -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); diff --git a/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp b/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp index 7887ac025..a71751dbf 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp @@ -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; diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp index 7aa183612..b369c1980 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -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 ®ular = 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(); diff --git a/Telegram/SourceFiles/info/common_groups/info_common_groups_widget.cpp b/Telegram/SourceFiles/info/common_groups/info_common_groups_widget.cpp index f8c1c85ca..8b3283419 100644 --- a/Telegram/SourceFiles/info/common_groups/info_common_groups_widget.cpp +++ b/Telegram/SourceFiles/info/common_groups/info_common_groups_widget.cpp @@ -100,7 +100,6 @@ void Widget::saveState(not_null memento) { void Widget::restoreState(not_null memento) { _inner->restoreState(memento); - auto scrollTop = memento->scrollTop(); scrollTopRestore(memento->scrollTop()); } diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index f53769e4e..dc924a319 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -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 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, diff --git a/Telegram/SourceFiles/info/members/info_members_widget.cpp b/Telegram/SourceFiles/info/members/info_members_widget.cpp index 45747d131..c3b33b842 100644 --- a/Telegram/SourceFiles/info/members/info_members_widget.cpp +++ b/Telegram/SourceFiles/info/members/info_members_widget.cpp @@ -92,7 +92,6 @@ void Widget::saveState(not_null memento) { void Widget::restoreState(not_null memento) { _inner->restoreState(memento->state()); - auto scrollTop = memento->scrollTop(); scrollTopRestore(memento->scrollTop()); } diff --git a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp index 82892d1e7..3eee8fc5a 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp @@ -668,7 +668,6 @@ int InnerWidget::desiredHeight() const { } void InnerWidget::setupContent() { - const auto quiz = _poll->quiz(); _content->add( object_ptr( _content, diff --git a/Telegram/SourceFiles/info/polls/info_polls_results_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_results_widget.cpp index 1d3dcdcdb..430a0c908 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_results_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_results_widget.cpp @@ -103,7 +103,6 @@ void Widget::saveState(not_null memento) { void Widget::restoreState(not_null memento) { _inner->restoreState(memento); - auto scrollTop = memento->scrollTop(); scrollTopRestore(memento->scrollTop()); } diff --git a/Telegram/SourceFiles/info/settings/info_settings_widget.cpp b/Telegram/SourceFiles/info/settings/info_settings_widget.cpp index c1fd45cd0..403c25b87 100644 --- a/Telegram/SourceFiles/info/settings/info_settings_widget.cpp +++ b/Telegram/SourceFiles/info/settings/info_settings_widget.cpp @@ -106,7 +106,6 @@ void Widget::saveState(not_null memento) { } void Widget::restoreState(not_null memento) { - const auto scrollTop = memento->scrollTop(); scrollTopRestore(memento->scrollTop()); } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index aab6e043b..59d95a022 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -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, not_null 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(this); that->_gif = Media::Clip::MakeReader( diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index 12c9ecd9a..cb8b225ee 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -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); diff --git a/Telegram/SourceFiles/lang/lang_file_parser.cpp b/Telegram/SourceFiles/lang/lang_file_parser.cpp index 740586926..0fb08f5c7 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.cpp +++ b/Telegram/SourceFiles/lang/lang_file_parser.cpp @@ -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(); diff --git a/Telegram/SourceFiles/main/main_session.cpp b/Telegram/SourceFiles/main/main_session.cpp index 55f8e3ca8..3a732c0ce 100644 --- a/Telegram/SourceFiles/main/main_session.cpp +++ b/Telegram/SourceFiles/main/main_session.cpp @@ -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( diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 2e3e5e3f0..a0c15092b 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -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; diff --git a/Telegram/SourceFiles/media/audio/media_audio.cpp b/Telegram/SourceFiles/media/audio/media_audio.cpp index dbd7ebc45..f4d31f590 100644 --- a/Telegram/SourceFiles/media/audio/media_audio.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio.cpp @@ -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) { diff --git a/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp b/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp index 1bd3d658d..ef1fc74d1 100644 --- a/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp +++ b/Telegram/SourceFiles/media/audio/media_child_ffmpeg_loader.cpp @@ -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 &&data) diff --git a/Telegram/SourceFiles/media/clip/media_clip_check_streaming.cpp b/Telegram/SourceFiles/media/clip/media_clip_check_streaming.cpp index 3e37dc7cf..247a88291 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_check_streaming.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_check_streaming.cpp @@ -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; diff --git a/Telegram/SourceFiles/media/clip/media_clip_reader.cpp b/Telegram/SourceFiles/media/clip/media_clip_reader.cpp index 8c8194e7e..98aeaced7 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_reader.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_reader.cpp @@ -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(); diff --git a/Telegram/SourceFiles/media/player/media_player_instance.cpp b/Telegram/SourceFiles/media/player/media_player_instance.cpp index af7dbb60f..0b55be131 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.cpp +++ b/Telegram/SourceFiles/media/player/media_player_instance.cpp @@ -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) { diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index f95653626..a0204515f 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -271,10 +271,6 @@ void Widget::handleSeekProgress(float64 progress) { void Widget::handleSeekFinished(float64 progress) { if (!_lastDurationMs) return; - const auto positionMs = std::clamp( - static_cast(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; diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_loader_mtproto.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_loader_mtproto.cpp index f18f6a288..80b990a9a 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_loader_mtproto.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_loader_mtproto.cpp @@ -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 owner, diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_player.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_player.cpp index fc6d036d6..3cdab3da1 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_player.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_player.cpp @@ -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> &packets) { _waitingForData = false; - auto audioTill = kTimeUnknown; - auto videoTill = kTimeUnknown; for (auto &[index, list] : packets) { if (list.empty()) { continue; diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp index a183779c2..1e3746807 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_utility.cpp @@ -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++; } diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp index 94518b1f3..67362555e 100644 --- a/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp +++ b/Telegram/SourceFiles/media/streaming/media_streaming_video_track.cpp @@ -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, diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 1bc6f4df4..b10e583ea 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -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); diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index efaf89b73..abe40cfb3 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -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)) { diff --git a/Telegram/SourceFiles/media/view/media_view_pip_raster.cpp b/Telegram/SourceFiles/media/view/media_view_pip_raster.cpp index 685850180..9dc52aca7 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip_raster.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip_raster.cpp @@ -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); } diff --git a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp index b9416bc94..0a7acd0ea 100644 --- a/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp +++ b/Telegram/SourceFiles/media/view/media_view_playback_controls.cpp @@ -468,7 +468,7 @@ void PlaybackControls::updatePlayPauseResumeState(const Player::TrackState &stat } void PlaybackControls::updateTimeTexts(const Player::TrackState &state) { - qint64 position = 0, length = state.length; + qint64 position = 0; if (Player::IsStoppedAtEnd(state.state)) { position = state.length; diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_bound_key_creator.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_bound_key_creator.cpp index c84a40bbd..7938c7acf 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_bound_key_creator.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_bound_key_creator.cpp @@ -79,7 +79,6 @@ AuthKeyPtr BoundKeyCreator::bindPersistentKey() const { bool IsDestroyedTemporaryKeyError(const mtpBuffer &buffer) { auto from = buffer.data(); - const auto end = from + buffer.size(); auto error = MTPRpcError(); if (!error.read(from, from + buffer.size())) { return false; diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.cpp index 8da3c22c9..c2e5dd17f 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_creator.cpp @@ -566,7 +566,6 @@ void DcKeyCreator::dhClientParamsAnswered( return failed(); } attempt->data.new_nonce_buf[32] = bytes::type(2); - uchar sha1Buffer[20]; if (data.vnew_nonce_hash2() != NonceDigest(attempt->data.new_nonce_buf)) { LOG(("AuthKey Error: received new_nonce_hash2 did not match!")); DEBUG_LOG(("AuthKey Error: received new_nonce_hash2: %1, new_nonce_buf: %2").arg(Logs::mb(&data.vnew_nonce_hash2(), 16).str(), Logs::mb(attempt->data.new_nonce_buf.data(), 41).str())); @@ -586,7 +585,6 @@ void DcKeyCreator::dhClientParamsAnswered( return failed(); } attempt->data.new_nonce_buf[32] = bytes::type(3); - uchar sha1Buffer[20]; if (data.vnew_nonce_hash3() != NonceDigest(attempt->data.new_nonce_buf)) { LOG(("AuthKey Error: received new_nonce_hash3 did not match!")); DEBUG_LOG(("AuthKey Error: received new_nonce_hash3: %1, new_nonce_buf: %2").arg(Logs::mb(&data.vnew_nonce_hash3(), 16).str(), Logs::mb(attempt->data.new_nonce_buf.data(), 41).str())); diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dcenter.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_dcenter.cpp index 7a1799f11..a98e24b48 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dcenter.cpp @@ -17,9 +17,6 @@ namespace MTP { namespace details { namespace { -constexpr auto kEnumerateDcTimeout = 8000; // 8 seconds timeout for help_getConfig to work (then move to other dc) -constexpr auto kSpecialRequestTimeoutMs = 6000; // 4 seconds timeout for it to work in a specially requested dc. - int IndexByType(TemporaryKeyType type) { switch (type) { case TemporaryKeyType::Regular: return 0; diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index 795e1c729..e6f28711b 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -33,7 +33,6 @@ namespace { constexpr auto kConfigBecomesOldIn = 2 * 60 * crl::time(1000); constexpr auto kConfigBecomesOldForBlockedIn = 8 * crl::time(1000); -constexpr auto kCheckKeyEach = 60 * crl::time(1000); using namespace details; @@ -1276,9 +1275,6 @@ bool Instance::Private::onErrorDefault( const auto requestId = response.requestId; const auto &type = error.type(); const auto code = error.code(); - if (!IsFloodError(error) && type != qstr("AUTH_KEY_UNREGISTERED")) { - int breakpoint = 0; - } auto badGuestDc = (code == 400) && (type == qsl("FILE_ID_INVALID")); QRegularExpressionMatch m1, m2; if ((m1 = QRegularExpression("^(FILE|PHONE|NETWORK|USER)_MIGRATE_(\\d+)$").match(type)).hasMatch()) { diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index 804c1ac0c..7eb05b76c 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -1962,7 +1962,7 @@ mtpBuffer SessionPrivate::ungzip(const mtpPrime *from, const mtpPrime *end) cons LOG(("RPC Error: could not read gziped bytes.")); return result; } - uint32 packedLen = packed.v.size(), unpackedChunk = packedLen, unpackedLen = 0; + uint32 packedLen = packed.v.size(), unpackedChunk = packedLen; z_stream stream; stream.zalloc = 0; @@ -2049,8 +2049,6 @@ void SessionPrivate::correctUnixtimeWithBadLocal(TimeId serverTime) { } void SessionPrivate::requestsAcked(const QVector &ids, bool byResponse) { - uint32 idsCount = ids.size(); - DEBUG_LOG(("Message Info: requests acked, ids %1").arg(LogIdsVector(ids))); QVector toAckMore; diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 890bf2928..9ccb0ac34 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -576,7 +576,6 @@ TextState Video::getState( } void Video::updateStatusText() { - bool showPause = false; int statusSize = 0; if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) { statusSize = Ui::FileStatusSizeFailed; @@ -1085,7 +1084,6 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con if (wthumb) { ensureDataMediaCreated(); const auto thumbnail = _dataMedia->thumbnail(); - const auto thumbLoaded = (thumbnail != nullptr); const auto blurred = _dataMedia->thumbnailInline(); if (thumbnail || blurred) { if (_thumb.isNull() || (thumbnail && !_thumbLoaded)) { @@ -1239,7 +1237,6 @@ TextState Document::getState( StateRequest request) const { ensureDataMediaCreated(); const auto loaded = dataLoaded(); - const auto wthumb = withThumb(); if (_data->isSong()) { const auto nameleft = _st.songPadding.left() + _st.songThumbSize + _st.songPadding.right(); @@ -1248,7 +1245,6 @@ TextState Document::getState( _width - nameleft - nameright, _name.maxWidth()); const auto nametop = _st.songNameTop; - const auto statustop = _st.songStatusTop; if (const auto state = cornerDownloadTextState(point, request); state.link) { return state; @@ -1285,7 +1281,6 @@ TextState Document::getState( const auto namewidth = std::min( _width - nameleft - nameright, _name.maxWidth()); - const auto statustop = st::linksBorder + _st.fileStatusTop; const auto datetop = st::linksBorder + _st.fileDateTop; const auto rthumb = style::rtlrect( diff --git a/Telegram/SourceFiles/passport/passport_form_controller.cpp b/Telegram/SourceFiles/passport/passport_form_controller.cpp index 618da418a..4f68164a9 100644 --- a/Telegram/SourceFiles/passport/passport_form_controller.cpp +++ b/Telegram/SourceFiles/passport/passport_form_controller.cpp @@ -292,7 +292,6 @@ bool ValueChanged(not_null value, const ValueMap &data) { return file.deleted; }; - auto filesCount = 0; for (const auto &scan : value->filesInEdit(FileType::Scan)) { if (FileChanged(scan)) { return true; @@ -1139,7 +1138,6 @@ void FormController::decryptValues() { void FormController::fillErrors() { const auto find = [&](const MTPSecureValueType &type) -> Value* { - const auto converted = ConvertType(type); const auto i = _form.values.find(ConvertType(type)); if (i != end(_form.values)) { return &i->second; @@ -1382,7 +1380,6 @@ void FormController::uploadScan( nullptr); if (type == FileType::Scan || type == FileType::Translation) { auto &list = nonconst->filesInEdit(type); - auto scanIndex = int(list.size()); list.push_back(std::move(scanInEdit)); return list.size() - 1; } diff --git a/Telegram/SourceFiles/passport/passport_panel_controller.cpp b/Telegram/SourceFiles/passport/passport_panel_controller.cpp index 6fe13111a..547c2ea46 100644 --- a/Telegram/SourceFiles/passport/passport_panel_controller.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_controller.cpp @@ -100,11 +100,11 @@ std::map PrepareSpecialFiles(const Value &value) { for (const auto type : types) { if (value.requiresSpecialScan(type)) { const auto i = value.specialScansInEdit.find(type); - const auto j = result.emplace( + result.emplace( type, (i != end(value.specialScansInEdit) ? CollectScanInfo(i->second) - : ScanInfo(type))).first; + : ScanInfo(type))); } } return result; @@ -1064,7 +1064,6 @@ void PanelController::editWithUpload(int index, int documentIndex) { const auto type = document->requiresSpecialScan(FileType::FrontSide) ? FileType::FrontSide : FileType::Scan; - const auto allowMany = (type == FileType::Scan); const auto widget = _panel->widget(); EditScans::ChooseScan(widget.get(), type, [=](QByteArray &&content) { if (_scopeDocumentTypeBox) { diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp index 59ca85cd9..bc89da5c1 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_contact.cpp @@ -102,7 +102,7 @@ void VerifyBox::setupControls( 0, st::boxPadding.right(), st::boxPadding.bottom()); - const auto description = _content->add( + _content->add( object_ptr( _content, text, @@ -123,7 +123,7 @@ void VerifyBox::setupControls( QString(), st::passportVerifyErrorLabel)), small); - const auto waiter = _content->add( + _content->add( object_ptr( _content, std::move(call), diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp index 506f07fe8..a93469046 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_document.cpp @@ -289,7 +289,7 @@ void PanelEditDocument::setupControls( ScanListData &&scans, std::optional &&translations, std::map &&specialFiles) { - const auto inner = setupContent( + setupContent( error, data, scansError, diff --git a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp index 88c668408..783677957 100644 --- a/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_edit_scans.cpp @@ -599,19 +599,6 @@ void EditScans::setupSpecialScans( std::map &&files) { const auto requiresBothSides = files.find(FileType::ReverseSide) != end(files); - const auto title = [&](FileType type) { - switch (type) { - case FileType::FrontSide: - return requiresBothSides - ? tr::lng_passport_front_side_title(tr::now) - : tr::lng_passport_main_page_title(tr::now); - case FileType::ReverseSide: - return tr::lng_passport_reverse_side_title(tr::now); - case FileType::Selfie: - return tr::lng_passport_selfie_title(tr::now); - } - Unexpected("Type in special row title."); - }; const auto uploadText = [=](FileType type, bool hasScan) { switch (type) { case FileType::FrontSide: diff --git a/Telegram/SourceFiles/passport/passport_panel_password.cpp b/Telegram/SourceFiles/passport/passport_panel_password.cpp index d0c9abacc..9dcf258d6 100644 --- a/Telegram/SourceFiles/passport/passport_panel_password.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_password.cpp @@ -171,7 +171,7 @@ void PanelNoPassword::setupContent() { _inner->resizeToWidth(newWidth); }, _inner->lifetime()); - const auto about1 = _inner->add( + _inner->add( object_ptr>( _inner, object_ptr( @@ -183,7 +183,7 @@ void PanelNoPassword::setupContent() { st::passportPasswordLabelBold)), st::passportPasswordAbout1Padding)->entity(); - const auto about2 = _inner->add( + _inner->add( object_ptr>( _inner, object_ptr( @@ -204,7 +204,7 @@ void PanelNoPassword::setupContent() { st::passportPasswordIcon, QPoint(0, 0)); - const auto about3 = _inner->add( + _inner->add( object_ptr>( _inner, object_ptr( diff --git a/Telegram/SourceFiles/passport/ui/passport_details_row.cpp b/Telegram/SourceFiles/passport/ui/passport_details_row.cpp index a93c30ebd..85337e8b9 100644 --- a/Telegram/SourceFiles/passport/ui/passport_details_row.cpp +++ b/Telegram/SourceFiles/passport/ui/passport_details_row.cpp @@ -683,7 +683,6 @@ void DateRow::paintEvent(QPaintEvent *e) { p.fillRect(0, height - _st.border, width, _st.border, _st.borderFg); } auto errorDegree = _a_error.value(_error ? 1. : 0.); - auto focusedDegree = _a_focused.value(_focused ? 1. : 0.); auto borderShownDegree = _a_borderShown.value(1.); auto borderOpacity = _a_borderOpacity.value(_borderVisible ? 1. : 0.); if (_st.borderActive && (borderOpacity > 0.)) { diff --git a/Telegram/SourceFiles/payments/payments_checkout_process.cpp b/Telegram/SourceFiles/payments/payments_checkout_process.cpp index efbb02d2b..058a411cb 100644 --- a/Telegram/SourceFiles/payments/payments_checkout_process.cpp +++ b/Telegram/SourceFiles/payments/payments_checkout_process.cpp @@ -62,7 +62,6 @@ void CheckoutProcess::Start( Mode mode, Fn reactivate) { auto &processes = LookupSessionProcesses(item); - const auto session = &item->history()->session(); const auto media = item->media(); const auto invoice = media ? media->invoice() : nullptr; if (mode == Mode::Payment && !invoice) { diff --git a/Telegram/SourceFiles/payments/ui/payments_field.cpp b/Telegram/SourceFiles/payments/ui/payments_field.cpp index 97b8244e7..a41946ca1 100644 --- a/Telegram/SourceFiles/payments/ui/payments_field.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_field.cpp @@ -341,7 +341,6 @@ struct SimpleFieldState { const auto updateRight = [=] { const auto text = result->getLastText(); const auto width = state->st.font->width(text); - const auto rect = result->getTextRect(); const auto &rule = state->rule; const auto symbol = QChar(rule.decimal); const auto decimal = text.indexOf(symbol); diff --git a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp index 585acc352..40807cb0d 100644 --- a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp @@ -231,8 +231,6 @@ void FormSummary::setupCover(not_null layout) { return; } const auto &padding = st::paymentsCoverPadding; - const auto thumbnailSkip = st::paymentsThumbnailSize.width() - + st::paymentsThumbnailSkip; const auto left = padding.left(); const auto top = padding.top(); const auto rect = QRect( diff --git a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp index 49a770c55..77906be6e 100644 --- a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp @@ -46,7 +46,6 @@ constexpr auto kBaseService = "org.telegram.desktop.BaseGtkIntegration-%1"_cs; constexpr auto kWebviewService = "org.telegram.desktop.GtkIntegration.WebviewHelper-%1-%2"_cs; constexpr auto kObjectPath = "/org/telegram/desktop/GtkIntegration"_cs; constexpr auto kInterface = "org.telegram.desktop.GtkIntegration"_cs; -constexpr auto kPropertiesInterface = "org.freedesktop.DBus.Properties"_cs; constexpr auto kGifcShmId = "tdesktop-gtk-gifc"_cs; constexpr auto kIntrospectionXML = R"INTROSPECTION( diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp index 40810db2c..c015e889e 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp @@ -562,7 +562,6 @@ QString XDPFileDialog::selectedNameFilter() const { } int XDPFileDialog::exec() { - bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose, false); bool wasShowModal = testAttribute(Qt::WA_ShowModal); diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 7cea2a999..2fa0be985 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -406,7 +406,7 @@ bool GenerateDesktopFile( } void SetDarkMode() { - static const auto Inited = [] { + [[maybe_unused]] static const auto Inited = [] { QObject::connect( qGuiApp, &QGuiApplication::paletteChanged, diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp index 552ddcf6d..4b38c9514 100644 --- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp +++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp @@ -197,7 +197,6 @@ void GroupMembersWidget::refreshMembers() { } fillChatMembers(chat); } else if (const auto megagroup = peer()->asMegagroup()) { - auto &megagroupInfo = megagroup->mgInfo; if (megagroup->lastParticipantsRequestNeeded()) { megagroup->session().api().requestLastParticipants(megagroup); } @@ -213,7 +212,7 @@ void GroupMembersWidget::checkSelfAdmin(not_null chat) { return; } - const auto self = chat->session().user(); + //const auto self = chat->session().user(); //if (chat->amAdmin() && !chat->admins.contains(self)) { // chat->admins.insert(self); //} else if (!chat->amAdmin() && chat->admins.contains(self)) { diff --git a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp index 60c198f62..7ab81b1bc 100644 --- a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp +++ b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp @@ -62,7 +62,6 @@ void PeerListWidget::visibleTopBottomUpdated(int visibleTop, int visibleBottom) void PeerListWidget::paintContents(Painter &p) { auto left = getListLeft(); auto top = getListTop(); - auto memberRowWidth = rowWidth(); auto from = floorclamp(_visibleTop - top, _st.height, 0, _items.size()); auto to = ceilclamp(_visibleBottom - top, _st.height, 0, _items.size()); diff --git a/Telegram/SourceFiles/settings/settings_chat.cpp b/Telegram/SourceFiles/settings/settings_chat.cpp index bbedcd3fd..913b8af59 100644 --- a/Telegram/SourceFiles/settings/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/settings_chat.cpp @@ -776,8 +776,6 @@ void SetupMessages( st::settingsSendType), st::settingsSendTypePadding); }; - const auto small = st::settingsSendTypePadding; - const auto top = skip; add(SendByType::Enter, tr::lng_settings_send_enter(tr::now)); add( SendByType::CtrlEnter, @@ -1129,7 +1127,6 @@ void SetupDefaultThemes( const auto fullSkips = width - count * single; const auto skip = fullSkips / float64(skips); auto left = padding.left() + 0.; - auto index = 0; for (const auto button : buttons) { button->resizeToWidth(single); button->moveToLeft(int(std::round(left)), 0); diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index 265fadfc5..bbd22050f 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -384,14 +384,13 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { return; } const auto found = find(button); - const auto &real = *i; const auto &now = found->filter; - if ((i->flags() != found->filter.flags()) - || (i->always() != found->filter.always()) - || (i->never() != found->filter.never())) { + if ((i->flags() != now.flags()) + || (i->always() != now.always()) + || (i->never() != now.never())) { return; } - button->updateCount(found->filter); + button->updateCount(now); found->postponedCountUpdate = false; }); }, button->lifetime()); @@ -441,7 +440,6 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { AddSkip(aboutRows); AddSubsectionTitle(aboutRows, tr::lng_filters_recommended()); - const auto changed = lifetime.make_state(); const auto suggested = lifetime.make_state>(); rpl::single( rpl::empty_value() diff --git a/Telegram/SourceFiles/settings/settings_intro.cpp b/Telegram/SourceFiles/settings/settings_intro.cpp index b7dda3132..bf0053b48 100644 --- a/Telegram/SourceFiles/settings/settings_intro.cpp +++ b/Telegram/SourceFiles/settings/settings_intro.cpp @@ -252,7 +252,6 @@ void IntroWidget::updateControlsGeometry() { _topShadow->moveToLeft(0, _topBar->height()); _wrap->setGeometry(contentGeometry()); - auto newScrollTop = _scroll->scrollTop(); auto scrollGeometry = _wrap->rect().marginsRemoved( QMargins(0, _scrollTopSkip.current(), 0, 0)); if (_scroll->geometry() != scrollGeometry) { diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index 0822464bf..3c4cdcef2 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -136,8 +136,6 @@ AdminLog::OwnedItem GenerateForwardedItem( // #TODO common global incrementable id for fake items, like clientMsgId. static auto id = ServerMaxMsgId + (ServerMaxMsgId / 6); const auto flags = Flag::f_from_id | Flag::f_fwd_from; - const auto replyTo = 0; - const auto viaBotId = 0; const auto item = MTP_message( MTP_flags(flags), MTP_int(++id), @@ -515,7 +513,6 @@ void LastSeenPrivacyController::confirmSave( bool someAreDisallowed, FnMut saveCallback) { if (someAreDisallowed && !Core::App().settings().lastSeenWarningSeen()) { - const auto session = _session; auto callback = [ =, saveCallback = std::move(saveCallback) @@ -841,7 +838,6 @@ void ForwardsPrivacyController::PaintForwardedTooltip( const auto textWidth = font->width(text); const auto arrowSkip = st::settingsForwardPrivacyArrowSkip; const auto arrowSize = st::settingsForwardPrivacyArrowSize; - const auto fullWidth = std::max(textWidth, 2 * arrowSkip); const auto padding = st::settingsForwardPrivacyTooltipPadding; const auto rect = QRect(0, 0, textWidth, font->height).marginsAdded( padding diff --git a/Telegram/SourceFiles/storage/file_download_web.cpp b/Telegram/SourceFiles/storage/file_download_web.cpp index 07fe3fa8b..51d78d03f 100644 --- a/Telegram/SourceFiles/storage/file_download_web.cpp +++ b/Telegram/SourceFiles/storage/file_download_web.cpp @@ -137,7 +137,6 @@ WebLoadManager::WebLoadManager() , _resetGenerationTimer(&_thread, [=] { resetGeneration(); }) { handleNetworkErrors(); - const auto original = QThread::currentThread(); _network->moveToThread(&_thread); QObject::connect(&_thread, &QThread::finished, [=] { clear(); diff --git a/Telegram/SourceFiles/storage/file_upload.cpp b/Telegram/SourceFiles/storage/file_upload.cpp index 3bbcbd985..9343caabf 100644 --- a/Telegram/SourceFiles/storage/file_upload.cpp +++ b/Telegram/SourceFiles/storage/file_upload.cpp @@ -219,9 +219,6 @@ Uploader::Uploader(not_null api) void Uploader::processPhotoProgress(const FullMsgId &newId) { const auto session = &_api->session(); if (const auto item = session->data().message(newId)) { - const auto photo = item->media() - ? item->media()->photo() - : nullptr; sendProgressUpdate(item, Api::SendProgressType::UploadPhoto); } } diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index b4b635f4d..21fd23500 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -58,7 +58,6 @@ using Database = Storage::Cache::Database; QString _basePath, _userBasePath, _userDbPath; -bool _started = false; TaskQueue *_localLoader = nullptr; QByteArray _settingsSalt; @@ -82,7 +81,6 @@ bool _useGlobalBackgroundKeys = false; bool _backgroundCanWrite = true; int32 _oldSettingsVersion = 0; -bool _settingsRewritten = false; bool _settingsRewriteNeeded = false; bool _settingsWriteAllowed = false; diff --git a/Telegram/SourceFiles/storage/storage_account.h b/Telegram/SourceFiles/storage/storage_account.h index 82eac45a4..2bf57b44f 100644 --- a/Telegram/SourceFiles/storage/storage_account.h +++ b/Telegram/SourceFiles/storage/storage_account.h @@ -62,7 +62,7 @@ public: ~Account(); [[nodiscard]] StartResult legacyStart(const QByteArray &passcode); - [[nodiscartd]] std::unique_ptr start( + [[nodiscard]] std::unique_ptr start( MTP::AuthKeyPtr localKey); void startAdded(MTP::AuthKeyPtr localKey); [[nodiscard]] int oldMapVersion() const { diff --git a/Telegram/SourceFiles/storage/storage_cloud_blob.cpp b/Telegram/SourceFiles/storage/storage_cloud_blob.cpp index c4c8f0578..f7e9c6bf9 100644 --- a/Telegram/SourceFiles/storage/storage_cloud_blob.cpp +++ b/Telegram/SourceFiles/storage/storage_cloud_blob.cpp @@ -126,9 +126,6 @@ rpl::producer BlobLoader::state() const { void BlobLoader::setImplementation( std::unique_ptr loader) { _implementation = std::move(loader); - auto convert = [](auto value) { - return BlobState(value); - }; _state = _implementation->progress( ) | rpl::map([](const Loading &state) { return BlobState(state); diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index 2ed5bf4f4..4af28aed3 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -480,7 +480,6 @@ void Autocomplete::submitValue(const QString &value) { if (value.startsWith(prefix)) { const auto line = value.indexOf('\n'); const auto text = (line > 0) ? value.mid(line + 1) : QString(); - const auto commented = !text.isEmpty(); const auto contact = value.mid( prefix.size(), (line > 0) ? (line - prefix.size()) : -1); diff --git a/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp b/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp index 4ab3bca2f..df18993e0 100644 --- a/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp +++ b/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp @@ -226,7 +226,7 @@ void AutoDeleteSettingsBox( const auto sliderCallback = [=](int index) { state->period = indexToPeriod(index); }; - const auto slider = box->addRow( + box->addRow( CreateSliderForTTL( box, options | ranges::to_vector, @@ -239,7 +239,7 @@ void AutoDeleteSettingsBox( st::boxRowPadding.right(), st::boxMediumSkip }); - const auto description = box->addRow( + box->addRow( object_ptr( box, object_ptr( diff --git a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp index 832eeed62..58af031ab 100644 --- a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp +++ b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp @@ -419,7 +419,6 @@ void TimeInput::paintEvent(QPaintEvent *e) { p.fillRect(0, height - _st.border, width(), _st.border, _st.borderFg); } auto errorDegree = _a_error.value(_error ? 1. : 0.); - auto focusedDegree = _a_focused.value(_focused ? 1. : 0.); auto borderShownDegree = _a_borderShown.value(1.); auto borderOpacity = _a_borderOpacity.value(_borderVisible ? 1. : 0.); if (_st.borderActive && (borderOpacity > 0.)) { diff --git a/Telegram/SourceFiles/ui/boxes/country_select_box.cpp b/Telegram/SourceFiles/ui/boxes/country_select_box.cpp index 06e81bd83..dcfed20b3 100644 --- a/Telegram/SourceFiles/ui/boxes/country_select_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/country_select_box.cpp @@ -360,7 +360,6 @@ void CountrySelectBox::Inner::updateFilter(QString filter) { if (!_filter.isEmpty()) { _filtered.clear(); for (const auto index : _byLetter[_filter[0].toLower()]) { - const auto &names = _namesList[index]; if (hasAllWords(_namesList[index])) { _filtered.push_back(_list[index]); } diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_single_file_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_single_file_preview.cpp index f4091ef0d..28fded211 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_single_file_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_single_file_preview.cpp @@ -124,9 +124,6 @@ void SingleFilePreview::preparePreview(const PreparedFile &file) { const auto &st = !isThumbedLayout() ? st::attachPreviewLayout : st::attachPreviewThumbLayout; - const auto nameleft = st.thumbSize + st.padding.right(); - const auto nametop = st.nameTop; - const auto statustop = st.statusTop; const auto availableFileWidth = st::sendMediaPreviewSize - st.thumbSize - st.padding.right() @@ -149,7 +146,6 @@ void SingleFilePreview::paintEvent(QPaintEvent *e) { Painter p(this); auto w = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); - auto h = height(); const auto &st = !isThumbedLayout() ? st::attachPreviewLayout : st::attachPreviewThumbLayout; diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index f9871a6bd..913fcd3c2 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -30,7 +30,6 @@ CountryInput::CountryInput(QWidget *parent, const style::InputField &st) , _text(tr::lng_country_code(tr::now)) { resize(_st.width, _st.heightMin); - auto availableWidth = width() - _st.textMargins.left() - _st.textMargins.right() - _st.placeholderMargins.left() - _st.placeholderMargins.right() - 1; auto placeholderFont = _st.placeholderFont->f; placeholderFont.setStyleStrategy(QFont::PreferMatch); //auto metrics = QFontMetrics(placeholderFont); diff --git a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp index 2aec274b6..f07e81a5a 100644 --- a/Telegram/SourceFiles/ui/effects/round_checkbox.cpp +++ b/Telegram/SourceFiles/ui/effects/round_checkbox.cpp @@ -275,7 +275,6 @@ void RoundCheckbox::paint(Painter &p, int x, int y, int outerWidth, float64 mast auto cacheSize = kWideScale * _st.size * cIntRetinaFactor(); auto cacheFrom = QRect(0, 0, cacheSize, cacheSize); - auto displayInactive = !_inactiveCacheBg.isNull(); auto inactiveTo = WideDestRect(&_st, x, y, masterScale); PainterHighQualityEnabler hq(p); diff --git a/Telegram/SourceFiles/ui/effects/send_action_animations.cpp b/Telegram/SourceFiles/ui/effects/send_action_animations.cpp index 6abfe71bf..378b5a4b4 100644 --- a/Telegram/SourceFiles/ui/effects/send_action_animations.cpp +++ b/Telegram/SourceFiles/ui/effects/send_action_animations.cpp @@ -18,7 +18,6 @@ namespace { constexpr int kTypingDotsCount = 3; constexpr int kRecordArcsCount = 4; constexpr int kUploadArrowsCount = 3; -constexpr int kSpeakingPartsCount = 3; constexpr auto kSpeakingDuration = 3200; constexpr auto kSpeakingFadeDuration = 400; diff --git a/Telegram/SourceFiles/ui/filter_icons.cpp b/Telegram/SourceFiles/ui/filter_icons.cpp index 83d84f943..f40e89a60 100644 --- a/Telegram/SourceFiles/ui/filter_icons.cpp +++ b/Telegram/SourceFiles/ui/filter_icons.cpp @@ -174,7 +174,6 @@ FilterIcon ComputeDefaultFilterIcon(const Data::ChatFilter &filter) { | Flag::Bots; const auto removed = Flag::NoRead | Flag::NoMuted; const auto people = Flag::Contacts | Flag::NonContacts; - const auto allNoArchive = all | Flag::NoArchived; if (!filter.always().empty() || !filter.never().empty() || !(filter.flags() & all)) { diff --git a/Telegram/SourceFiles/ui/grouped_layout.cpp b/Telegram/SourceFiles/ui/grouped_layout.cpp index 82b688a7b..0290f7bbe 100644 --- a/Telegram/SourceFiles/ui/grouped_layout.cpp +++ b/Telegram/SourceFiles/ui/grouped_layout.cpp @@ -510,7 +510,6 @@ std::vector ComplexLayouter::layout() const { const auto totalHeight = ranges::accumulate(heights, 0.) + _spacing * (lineCount - 1); const auto minLineHeight = ranges::min(heights); - const auto maxLineHeight = ranges::max(heights); const auto bad1 = (minLineHeight < _minWidth) ? 1.5 : 1.; const auto bad2 = [&] { for (auto line = 1; line != lineCount; ++line) { diff --git a/Telegram/SourceFiles/ui/widgets/multi_select.cpp b/Telegram/SourceFiles/ui/widgets/multi_select.cpp index f16ce29c7..cd95b9e20 100644 --- a/Telegram/SourceFiles/ui/widgets/multi_select.cpp +++ b/Telegram/SourceFiles/ui/widgets/multi_select.cpp @@ -124,7 +124,6 @@ bool MultiSelect::Item::paintCached(Painter &p, int x, int y, int outerWidth) { PainterHighQualityEnabler hq(p); auto opacity = _visibility.value(_hiding ? 0. : 1.); - auto scale = opacity + _st.minScale * (1. - opacity); auto height = opacity * _cache.height() / _cache.devicePixelRatio(); auto width = opacity * _cache.width() / _cache.devicePixelRatio(); @@ -749,7 +748,7 @@ void MultiSelect::Inner::removeItem(uint64 itemId) { item->hideAnimated(); _idsMap.erase(item->id()); - auto inserted = _removingItems.insert(std::move(item)); + _removingItems.insert(std::move(item)); _items.erase(_items.begin() + i); if (_active == i) { diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 41359366d..f22a5d6a0 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -80,7 +80,6 @@ void ConvertIconToBlack(QImage &image) { constexpr auto igreen = shifter(green); constexpr auto iblue = shifter(blue); constexpr auto threshold = 100; - constexpr auto ithreshold = shifter(threshold); const auto width = image.width(); const auto height = image.height(); @@ -789,7 +788,6 @@ void MainWindow::showRightColumn(object_ptr widget) { setInnerFocus(); } const auto nowRightWidth = _rightColumn ? _rightColumn->width() : 0; - const auto wasMaximized = isMaximized(); const auto wasMinimumWidth = minimumWidth(); const auto nowMinimumWidth = computeMinWidth(); const auto firstResize = (nowMinimumWidth < wasMinimumWidth); diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index db352c9b6..d5f54c917 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -363,7 +363,6 @@ void System::showNext() { auto ms = crl::now(), nextAlert = crl::time(0); bool alert = false; - int32 now = base::unixtime::now(); for (auto i = _whenAlerts.begin(); i != _whenAlerts.end();) { while (!i->second.empty() && i->second.begin()->first <= ms) { const auto peer = i->first->peer; diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index 1c090e649..cd7d6ac96 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -286,7 +286,6 @@ void Manager::moveWidgets() { } if (count > 1 || !_queuedNotifications.empty()) { - auto deltaY = st::notifyHideAllHeight + st::notifyDeltaY; if (!_hideAll) { _hideAll = std::make_unique(this, notificationStartPosition(), lastShiftCurrent, notificationShiftDirection()); } @@ -728,7 +727,6 @@ void Notification::paintEvent(QPaintEvent *e) { p.setClipRect(e->rect()); p.drawPixmap(0, 0, _cache); - auto buttonsLeft = st::notifyPhotoPos.x() + st::notifyPhotoSize + st::notifyTextLeft; auto buttonsTop = st::notifyTextTop + st::msgNameFont->height; if (a_actionsOpacity.animating()) { p.setOpacity(a_actionsOpacity.value(1.)); diff --git a/Telegram/SourceFiles/window/notifications_utilities.cpp b/Telegram/SourceFiles/window/notifications_utilities.cpp index 8fe8aa584..43bd96016 100644 --- a/Telegram/SourceFiles/window/notifications_utilities.cpp +++ b/Telegram/SourceFiles/window/notifications_utilities.cpp @@ -31,7 +31,6 @@ CachedUserpics::CachedUserpics(Type type) CachedUserpics::~CachedUserpics() { if (_someSavedFlag) { - crl::time result = 0; for (const auto &item : std::as_const(_images)) { QFile(item.path).remove(); } diff --git a/Telegram/SourceFiles/window/themes/window_theme.cpp b/Telegram/SourceFiles/window/themes/window_theme.cpp index 0675156df..d9f6208ab 100644 --- a/Telegram/SourceFiles/window/themes/window_theme.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme.cpp @@ -1367,7 +1367,6 @@ QColor CountAverageColor(const QImage &image) { Expects(image.format() == QImage::Format_ARGB32_Premultiplied); uint64 components[3] = { 0 }; - uint64 componentsScroll[3] = { 0 }; const auto w = image.width(); const auto h = image.height(); const auto size = w * h; diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp index fc3c2711e..0403e7dc3 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp @@ -164,16 +164,13 @@ bool isValidColorValue(QLatin1String value) { skipWhitespacesAndComments(data, end); if (data == end) break; - auto foundName = base::parse::readName(data, end); skipWhitespacesAndComments(data, end); if (data == end || *data != ':') { return "error"; } ++data; skipWhitespacesAndComments(data, end); - auto valueStart = data; auto value = readValue(data, end); - auto valueEnd = data; if (value.size() == 0) { return "error"; } diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index ea0812698..67fba5b31 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -540,7 +540,6 @@ void EditorBlock::saveEditing(QColor value) { auto &row = _data[_editing]; auto name = row.name(); if (_type == Type::New) { - auto removing = std::exchange(_editing, -1); setSelected(-1); setPressed(-1); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp index 55d21f6a7..7d42c0e6d 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp @@ -697,9 +697,6 @@ void CreateForExistingBox( not_null box, not_null window, const Data::CloudTheme &cloud) { - const auto userId = window->account().sessionExists() - ? window->account().session().userId() - : UserId(-1); const auto amCreator = window->account().sessionExists() && (window->account().session().userId() == cloud.createdBy); box->setTitle(amCreator @@ -794,7 +791,6 @@ struct CollectedData { : ParseTheme(original); const auto background = Background()->createCurrentImage(); - const auto backgroundIsTiled = Background()->tile(); const auto changed = !Data::IsThemeWallPaper(Background()->paper()) || originalParsed.background.isEmpty() || ColorizerForTheme(original.pathAbsolute); diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index 33b068be2..294db4211 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -773,10 +773,8 @@ void Generator::paintBubble(const Bubble &bubble) { } else if (!bubble.waveform.isEmpty()) { const auto &st = st::msgFileLayout; auto nameleft = x + st.padding.left() + st.thumbSize + st.padding.right(); - auto nametop = y + st.nameTop; auto nameright = st.padding.left(); auto statustop = y + st.statusTop; - auto bottom = y + st.padding.top() + st.thumbSize + st.padding.bottom(); auto inner = style::rtlrect(x + st.padding.left(), y + st.padding.top(), st.thumbSize, st.thumbSize, _rect.width()); _p->setPen(Qt::NoPen); diff --git a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp index 19d94215b..2d721bd54 100644 --- a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp +++ b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp @@ -271,8 +271,6 @@ void CloudListCheck::paintWithColors( p.setBrush(_colors->sent); p.drawRoundedRect(style::rtlrect(sent, outerWidth), radius, radius); - const auto skip = st::settingsThemeRadioBottom / 2; - const auto radio = _radio.getSize(); _radio.paint( p, @@ -708,7 +706,6 @@ void CloudList::updateGeometry() { } int CloudList::resizeGetHeight(int newWidth) { - const auto desired = st::settingsThemePreviewSize.width(); const auto minSkip = st::settingsThemeMinSkip; const auto single = std::min( st::settingsThemePreviewSize.width(), diff --git a/Telegram/SourceFiles/window/window_connecting_widget.cpp b/Telegram/SourceFiles/window/window_connecting_widget.cpp index f7c4e3839..1693c4a3b 100644 --- a/Telegram/SourceFiles/window/window_connecting_widget.cpp +++ b/Telegram/SourceFiles/window/window_connecting_widget.cpp @@ -440,9 +440,6 @@ auto ConnectionState::computeLayout(const State &state) const -> Layout { break; } result.textWidth = st::normalFont->width(result.text); - const auto maxTextWidth = (state.type == State::Type::Waiting) - ? st::normalFont->width(tr::lng_reconnecting(tr::now, lt_count, 88)) - : result.textWidth; result.contentWidth = (result.textWidth > 0) ? (st::connectingTextPadding.left() + result.textWidth diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index 0720d1f56..307331a0a 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -66,7 +66,7 @@ namespace { constexpr auto kMinDiffIntensity = 0.25; -[[nodicard]] float64 IntensityOfColor(QColor color) { +[[nodiscard]] float64 IntensityOfColor(QColor color) { return (0.299 * color.red() + 0.587 * color.green() + 0.114 * color.blue()) / 255.0; @@ -397,7 +397,6 @@ void MainMenu::ToggleAccountsButton::paintEvent(QPaintEvent *e) { const auto left = x - size; const auto right = x + size; const auto bottom = y + size2; - const auto top = y - size2; constexpr auto kPointCount = 6; std::array points = { { { left - stroke, bottom - stroke }, diff --git a/Telegram/SourceFiles/window/window_slide_animation.cpp b/Telegram/SourceFiles/window/window_slide_animation.cpp index 6612fd52e..d035d0ed9 100644 --- a/Telegram/SourceFiles/window/window_slide_animation.cpp +++ b/Telegram/SourceFiles/window/window_slide_animation.cpp @@ -85,7 +85,6 @@ void SlideAnimation::setFinishedCallback(FinishedCallback &&callback) { } void SlideAnimation::start() { - auto delta = st::slideShift; auto fromLeft = (_direction == SlideDirection::FromLeft); if (fromLeft) std::swap(_cacheUnder, _cacheOver); _animation.start( diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake index 761672803..6c97e3c7f 100644 --- a/Telegram/cmake/lib_tgvoip.cmake +++ b/Telegram/cmake/lib_tgvoip.cmake @@ -161,15 +161,21 @@ if (NOT TGVOIP_FOUND) ) endif() else() - target_compile_options(lib_tgvoip_bundled - PRIVATE + add_library(lib_tgvoip_bundled_options INTERFACE) + target_compile_options(lib_tgvoip_bundled_options + INTERFACE + -Wno-unused-variable -Wno-unknown-pragmas -Wno-error=sequence-point -Wno-error=unused-result ) if (build_linux32 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*") - target_compile_options(lib_tgvoip_bundled PRIVATE -msse2) + target_compile_options(lib_tgvoip_bundled_options INTERFACE -msse2) endif() + target_link_libraries(lib_tgvoip_bundled + PRIVATE + lib_tgvoip_bundled_options + ) endif() target_include_directories(lib_tgvoip_bundled