From 9ad1d1c25db2d9836a18a5919335a3a49af54e0d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 12 Apr 2025 20:44:45 +0300 Subject: [PATCH] Fixed some unused-but-set-variable warnings. --- .../SourceFiles/api/api_messages_search.cpp | 4 ++-- Telegram/SourceFiles/api/api_statistics.cpp | 2 +- .../boxes/peers/add_participants_box.cpp | 2 +- .../boxes/peers/choose_peer_box.cpp | 2 +- .../boxes/peers/edit_participants_box.cpp | 6 +++--- Telegram/SourceFiles/boxes/star_gift_box.cpp | 2 +- .../SourceFiles/boxes/sticker_set_box.cpp | 4 ++-- Telegram/SourceFiles/boxes/url_auth_box.cpp | 2 +- .../calls/calls_box_controller.cpp | 2 +- .../chat_helpers/emoji_list_widget.cpp | 4 ++-- .../chat_helpers/message_field.cpp | 2 +- .../data/components/location_pickers.cpp | 4 ++-- Telegram/SourceFiles/data/data_channel.cpp | 2 +- .../SourceFiles/data/data_chat_filters.cpp | 2 +- .../SourceFiles/data/data_cloud_themes.cpp | 2 +- .../SourceFiles/data/data_media_types.cpp | 6 +++--- Telegram/SourceFiles/data/data_peer.cpp | 4 ++-- .../SourceFiles/data/data_peer_values.cpp | 4 ++-- .../SourceFiles/data/data_photo_media.cpp | 4 ++-- .../SourceFiles/data/data_replies_list.cpp | 2 +- Telegram/SourceFiles/data/data_session.cpp | 2 +- .../dialogs/dialogs_inner_widget.cpp | 2 +- .../SourceFiles/dialogs/dialogs_widget.cpp | 2 +- .../dialogs/ui/dialogs_suggestions.cpp | 4 ++-- .../export/data/export_data_types.cpp | 12 +++++------ Telegram/SourceFiles/history/history.cpp | 21 ++++++++----------- .../history/history_inner_widget.cpp | 9 +++++--- Telegram/SourceFiles/history/history_item.cpp | 6 +++--- .../history/history_item_helpers.cpp | 2 +- .../SourceFiles/history/history_widget.cpp | 2 +- .../controls/history_view_forward_panel.cpp | 2 +- .../history/view/history_view_bottom_info.cpp | 2 +- .../view/history_view_context_menu.cpp | 4 ++-- .../history/view/history_view_list_widget.cpp | 4 ++-- .../history/view/history_view_message.cpp | 6 +++--- .../view/history_view_top_bar_widget.cpp | 2 +- .../view/media/history_view_document.cpp | 4 ++-- .../view/media/history_view_media_generic.cpp | 2 +- .../view/media/history_view_premium_gift.cpp | 2 +- .../starref/info_bot_starref_setup_widget.cpp | 2 +- .../info/profile/info_profile_actions.cpp | 2 +- .../info/profile/info_profile_widget.cpp | 2 +- .../inline_bot_layout_internal.cpp | 4 ++-- Telegram/SourceFiles/mainwidget.cpp | 4 ++-- .../media/player/media_player_widget.cpp | 2 +- .../media/stories/media_stories_reply.cpp | 3 +-- .../SourceFiles/overview/overview_layout.cpp | 2 +- .../settings/settings_credits_graphics.cpp | 2 +- .../SourceFiles/settings/settings_folders.cpp | 2 +- .../SourceFiles/storage/file_download_web.cpp | 2 +- .../storage/storage_media_prepare.cpp | 2 +- .../ui/chat/group_call_userpics.cpp | 2 +- .../ui/effects/reaction_fly_animation.cpp | 4 ++-- .../ui/widgets/chat_filters_tabs_slider.cpp | 2 +- .../SourceFiles/window/window_peer_menu.cpp | 8 +++---- 55 files changed, 98 insertions(+), 99 deletions(-) diff --git a/Telegram/SourceFiles/api/api_messages_search.cpp b/Telegram/SourceFiles/api/api_messages_search.cpp index 8bc7a4e3d4..fb390564ef 100644 --- a/Telegram/SourceFiles/api/api_messages_search.cpp +++ b/Telegram/SourceFiles/api/api_messages_search.cpp @@ -28,8 +28,8 @@ constexpr auto kSearchPerPage = 50; auto result = MessageIdsList(); for (const auto &message : messages) { const auto peerId = PeerFromMessage(message); - if (const auto peer = data->peerLoaded(peerId)) { - if (const auto lastDate = DateFromMessage(message)) { + if (data->peerLoaded(peerId)) { + if (DateFromMessage(message)) { const auto item = data->addNewMessage( message, MessageFlags(), diff --git a/Telegram/SourceFiles/api/api_statistics.cpp b/Telegram/SourceFiles/api/api_statistics.cpp index daed8f1eef..400ad7fcae 100644 --- a/Telegram/SourceFiles/api/api_statistics.cpp +++ b/Telegram/SourceFiles/api/api_statistics.cpp @@ -313,7 +313,7 @@ void PublicForwards::request( const auto msgId = IdFromMessage(message); const auto peerId = PeerFromMessage(message); const auto lastDate = DateFromMessage(message); - if (const auto peer = owner.peerLoaded(peerId)) { + if (owner.peerLoaded(peerId)) { if (!lastDate) { return; } diff --git a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp index 4701cac1e7..ad0bb57e77 100644 --- a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp @@ -808,7 +808,7 @@ void AddParticipantsBoxController::rowClicked(not_null row) { updateTitle(); } else if (const auto channel = _peer ? _peer->asChannel() : nullptr) { if (!_peer->isMegagroup()) { - showBox(Box(_peer->asChannel())); + showBox(Box(channel)); } } else if (count >= serverConfig.chatSizeMax && count < serverConfig.megagroupSizeMax) { diff --git a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp index 33ce09ac44..bc336675f8 100644 --- a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp @@ -453,7 +453,7 @@ void ChoosePeerBoxController::rowClicked(not_null row) { const auto onstack = callback; onstack({ peer }); }; - if (const auto user = peer->asUser()) { + if (peer->isUser()) { done(); } else { delegate()->peerListUiShow()->showBox( diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index 1147922a04..e168e800e0 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -689,7 +689,7 @@ UserData *ParticipantsAdditionalData::applyAdmin( const auto user = _peer->owner().userLoaded(data.userId()); if (!user) { return nullptr; - } else if (const auto chat = _peer->asChat()) { + } else if (_peer->isChat()) { // This can come from saveAdmin callback. _admins.emplace(user); return user; @@ -733,7 +733,7 @@ UserData *ParticipantsAdditionalData::applyRegular(UserId userId) { const auto user = _peer->owner().userLoaded(userId); if (!user) { return nullptr; - } else if (const auto chat = _peer->asChat()) { + } else if (_peer->isChat()) { // This can come from saveAdmin or saveRestricted callback. _admins.erase(user); return user; @@ -913,7 +913,7 @@ void ParticipantsBoxController::setupListChangeViewers() { return; } } - if (const auto row = delegate()->peerListFindRow(user->id.value)) { + if (delegate()->peerListFindRow(user->id.value)) { delegate()->peerListPartitionRows([&](const PeerListRow &row) { return (row.peer() == user); }); diff --git a/Telegram/SourceFiles/boxes/star_gift_box.cpp b/Telegram/SourceFiles/boxes/star_gift_box.cpp index f02ea735c8..e20967b2e9 100644 --- a/Telegram/SourceFiles/boxes/star_gift_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_box.cpp @@ -1793,7 +1793,7 @@ void SendGiftBox( ShowSentToast(window, details.descriptor, details); } if (const auto strong = weak.data()) { - box->closeBox(); + strong->closeBox(); } }; SendGift(window, peer, api, details, done); diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 8ddbb7720d..3c7380f914 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -1510,7 +1510,7 @@ void StickerSetBox::Inner::fillDeleteStickerBox( sticker->paintRequest( ) | rpl::start_with_next([=] { auto p = Painter(sticker); - if (const auto strong = weak.data()) { + if ([[maybe_unused]] const auto strong = weak.data()) { const auto paused = On(PowerSaving::kStickersPanel) || show->paused(ChatHelpers::PauseReason::Layer); paintSticker(p, index, QPoint(), paused, crl::now()); @@ -1564,7 +1564,7 @@ void StickerSetBox::Inner::fillDeleteStickerBox( Data::StickersType::Stickers); }, [](const auto &) { }); - if (const auto strong = weak.data()) { + if ([[maybe_unused]] const auto strong = weak.data()) { applySet(result); } if (const auto strongBox = weakBox.data()) { diff --git a/Telegram/SourceFiles/boxes/url_auth_box.cpp b/Telegram/SourceFiles/boxes/url_auth_box.cpp index ef72584cf5..3dc29d9222 100644 --- a/Telegram/SourceFiles/boxes/url_auth_box.cpp +++ b/Telegram/SourceFiles/boxes/url_auth_box.cpp @@ -144,7 +144,7 @@ void UrlAuthBox::Request( const auto callback = [=](Result result) { if (result == Result::None) { finishWithUrl(url); - } else if (const auto msg = session->data().message(itemId)) { + } else if (session->data().message(itemId)) { const auto allowWrite = (result == Result::AuthAndAllowWrite); using Flag = MTPmessages_AcceptUrlAuth::Flag; const auto flags = (allowWrite ? Flag::f_write_allowed : Flag(0)) diff --git a/Telegram/SourceFiles/calls/calls_box_controller.cpp b/Telegram/SourceFiles/calls/calls_box_controller.cpp index 96d064ec34..8e093719fc 100644 --- a/Telegram/SourceFiles/calls/calls_box_controller.cpp +++ b/Telegram/SourceFiles/calls/calls_box_controller.cpp @@ -611,7 +611,7 @@ void BoxController::receivedCalls(const QVector &result) { for (const auto &message : result) { const auto msgId = IdFromMessage(message); const auto peerId = PeerFromMessage(message); - if (const auto peer = session().data().peerLoaded(peerId)) { + if (session().data().peerLoaded(peerId)) { const auto item = session().data().addNewMessage( message, MessageFlags(), diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index dde73d671a..ec9df7d3c2 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -2104,7 +2104,7 @@ void EmojiListWidget::colorChosen(EmojiChosen data) { const auto emoji = data.emoji; auto &settings = Core::App().settings(); - if (const auto button = std::get_if(&_pickerSelected)) { + if (v::is(_pickerSelected)) { settings.saveAllEmojiVariants(emoji); for (auto section = int(Section::People) ; section < _staticCount @@ -2425,7 +2425,7 @@ Ui::Text::CustomEmoji *EmojiListWidget::resolveCustomRecent( const auto &data = customId.data; if (const auto document = std::get_if(&data)) { return resolveCustomRecent(document->id); - } else if (const auto emoji = std::get_if(&data)) { + } else if (v::is(data)) { return nullptr; } Unexpected("Custom recent emoji id."); diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp index b9e26419e0..200ad997e8 100644 --- a/Telegram/SourceFiles/chat_helpers/message_field.cpp +++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp @@ -765,7 +765,7 @@ InlineBotQuery ParseInlineBotQuery( result.username = username.toString(); if (const auto peer = session->data().peerByUsername(result.username)) { if (const auto user = peer->asUser()) { - result.bot = peer->asUser(); + result.bot = user; } else { result.bot = nullptr; } diff --git a/Telegram/SourceFiles/data/components/location_pickers.cpp b/Telegram/SourceFiles/data/components/location_pickers.cpp index 4402e4ccf8..7f15a30da1 100644 --- a/Telegram/SourceFiles/data/components/location_pickers.cpp +++ b/Telegram/SourceFiles/data/components/location_pickers.cpp @@ -25,7 +25,7 @@ Ui::LocationPicker *LocationPickers::lookup(const Api::SendAction &action) { for (auto i = begin(_pickers); i != end(_pickers);) { if (const auto strong = i->picker.get()) { if (i->action == action) { - return i->picker.get(); + return strong; } ++i; } else { @@ -41,4 +41,4 @@ void LocationPickers::emplace( _pickers.push_back({ action, picker }); } -} // namespace Data \ No newline at end of file +} // namespace Data diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index f21769328a..a4f4092e8b 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -956,7 +956,7 @@ QString ChannelData::invitePeekHash() const { } void ChannelData::privateErrorReceived() { - if (const auto expires = invitePeekExpires()) { + if (invitePeekExpires()) { const auto hash = invitePeekHash(); for (const auto &window : session().windows()) { clearInvitePeek(); diff --git a/Telegram/SourceFiles/data/data_chat_filters.cpp b/Telegram/SourceFiles/data/data_chat_filters.cpp index a53a8f5c62..4a0d0c2331 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.cpp +++ b/Telegram/SourceFiles/data/data_chat_filters.cpp @@ -347,7 +347,7 @@ bool ChatFilter::contains( : user->isContact() ? Flag::Contacts : Flag::NonContacts; - } else if (const auto chat = peer->asChat()) { + } else if (peer->isChat()) { return Flag::Groups; } else if (const auto channel = peer->asChannel()) { if (channel->isBroadcast()) { diff --git a/Telegram/SourceFiles/data/data_cloud_themes.cpp b/Telegram/SourceFiles/data/data_cloud_themes.cpp index 5ac1c2052c..56c7647dac 100644 --- a/Telegram/SourceFiles/data/data_cloud_themes.cpp +++ b/Telegram/SourceFiles/data/data_cloud_themes.cpp @@ -238,7 +238,7 @@ void CloudThemes::showPreview( void CloudThemes::showPreview( not_null controller, const CloudTheme &cloud) { - if (const auto documentId = cloud.documentId) { + if (cloud.documentId) { previewFromDocument(controller, cloud); } else if (cloud.createdBy == _session->userId()) { controller->show(Box( diff --git a/Telegram/SourceFiles/data/data_media_types.cpp b/Telegram/SourceFiles/data/data_media_types.cpp index 97ef0e6d65..2be78e44fc 100644 --- a/Telegram/SourceFiles/data/data_media_types.cpp +++ b/Telegram/SourceFiles/data/data_media_types.cpp @@ -1111,7 +1111,7 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const { return toGroupPreview(group->items, options); } } - if (const auto sticker = _document->sticker()) { + if (_document->sticker()) { return Media::toPreview(options); } auto images = std::vector(); @@ -1178,7 +1178,7 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const { } TextWithEntities MediaFile::notificationText() const { - if (const auto sticker = _document->sticker()) { + if (_document->sticker()) { const auto text = _emoji.isEmpty() ? tr::lng_in_dlg_sticker(tr::now) : tr::lng_in_dlg_sticker_emoji(tr::now, lt_emoji, _emoji); @@ -1210,7 +1210,7 @@ TextWithEntities MediaFile::notificationText() const { } QString MediaFile::pinnedTextSubstring() const { - if (const auto sticker = _document->sticker()) { + if (_document->sticker()) { if (!_emoji.isEmpty()) { return tr::lng_action_pinned_media_emoji_sticker( tr::now, diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 41d5d19e68..592fc1edfb 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -703,7 +703,7 @@ bool PeerData::canTransferGifts() const { bool PeerData::canEditMessagesIndefinitely() const { if (const auto user = asUser()) { return user->isSelf(); - } else if (const auto chat = asChat()) { + } else if (isChat()) { return false; } else if (const auto channel = asChannel()) { return channel->isMegagroup() @@ -1410,7 +1410,7 @@ Data::ForumTopic *PeerData::forumTopicFor(MsgId rootId) const { } bool PeerData::allowsForwarding() const { - if (const auto user = asUser()) { + if (isUser()) { return true; } else if (const auto channel = asChannel()) { return channel->allowsForwarding(); diff --git a/Telegram/SourceFiles/data/data_peer_values.cpp b/Telegram/SourceFiles/data/data_peer_values.cpp index b79b1dbe8e..287dd2e42b 100644 --- a/Telegram/SourceFiles/data/data_peer_values.cpp +++ b/Telegram/SourceFiles/data/data_peer_values.cpp @@ -599,7 +599,7 @@ rpl::producer UniqueReactionsLimitValue( ) | rpl::map([config = &peer->session().appConfig()] { return UniqueReactionsLimit(config); }) | rpl::distinct_until_changed(); - if (const auto channel = peer->asChannel()) { + if (peer->isChannel()) { return rpl::combine( PeerAllowedReactionsValue(peer), std::move(configValue) @@ -608,7 +608,7 @@ rpl::producer UniqueReactionsLimitValue( ? allowedReactions.maxCount : limit; }); - } else if (const auto chat = peer->asChat()) { + } else if (peer->isChat()) { return rpl::combine( PeerAllowedReactionsValue(peer), std::move(configValue) diff --git a/Telegram/SourceFiles/data/data_photo_media.cpp b/Telegram/SourceFiles/data/data_photo_media.cpp index af01588f45..06a52ed4dc 100644 --- a/Telegram/SourceFiles/data/data_photo_media.cpp +++ b/Telegram/SourceFiles/data/data_photo_media.cpp @@ -65,13 +65,13 @@ QByteArray PhotoMedia::imageBytes(PhotoSize size) const { auto PhotoMedia::resolveLoadedImage(PhotoSize size) const -> const PhotoImage * { const auto &original = _images[PhotoSizeIndex(size)]; - if (const auto image = original.data.get()) { + if (original.data) { if (original.goodFor >= size) { return &original; } } const auto &valid = _images[_owner->validSizeIndex(size)]; - if (const auto image = valid.data.get()) { + if (valid.data.get()) { if (valid.goodFor >= size) { return &valid; } diff --git a/Telegram/SourceFiles/data/data_replies_list.cpp b/Telegram/SourceFiles/data/data_replies_list.cpp index 2a962dc1b6..f334c47d1d 100644 --- a/Telegram/SourceFiles/data/data_replies_list.cpp +++ b/Telegram/SourceFiles/data/data_replies_list.cpp @@ -366,7 +366,7 @@ bool RepliesList::buildFromData(not_null viewer) { const auto around = [&] { if (viewer->around != ShowAtUnreadMsgId) { return viewer->around; - } else if (const auto item = lookupRoot()) { + } else if (lookupRoot()) { return computeInboxReadTillFull(); } else if (_owningTopic) { // Somehow we don't want always to jump to computed inboxReadTill diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 5b74b76561..098315878d 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -2231,7 +2231,7 @@ void Session::applyDialog( } bool Session::pinnedCanPin(not_null entry) const { - if (const auto sublist = entry->asSublist()) { + if ([[maybe_unused]] const auto sublist = entry->asSublist()) { const auto saved = &savedMessages(); return pinnedChatsOrder(saved).size() < pinnedChatsLimit(saved); } else if (const auto topic = entry->asTopic()) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 5ed9dd391c..970d1507de 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -4756,7 +4756,7 @@ bool InnerWidget::chooseRow( } if (!chosen.message.fullId) { if (const auto history = chosen.key.history()) { - if (const auto forum = history->peer->forum()) { + if (history->peer->forum()) { if (pressedTopicRootId) { chosen.message.fullId = { history->peer->id, diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index b76b82de89..9d873db04a 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -806,7 +806,7 @@ void Widget::setupSwipeBack() { } return Ui::Controls::DefaultSwipeBackHandlerFinishData([=] { _swipeBackData = {}; - if (const auto forum = controller()->shownForum().current()) { + if (controller()->shownForum().current()) { controller()->closeForum(); } }); diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp index 4ae07e5a92..6b2ab882e6 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp @@ -952,7 +952,7 @@ void MyChannelsController::prepare() { const auto add = [&](not_null list) { for (const auto &row : list->indexed()->all()) { if (const auto history = row->history()) { - if (const auto channel = history->peer->asBroadcast()) { + if (history->peer->isBroadcast()) { _channels.push_back(history); } } @@ -981,7 +981,7 @@ void MyChannelsController::prepare() { const auto list = owner->chatsList(folder); for (const auto &row : list->indexed()->all()) { if (const auto history = row->history()) { - if (const auto channel = history->peer->asBroadcast()) { + if (history->peer->isBroadcast()) { if (ranges::contains(_channels, not_null(history))) { _channels.push_back(history); } diff --git a/Telegram/SourceFiles/export/data/export_data_types.cpp b/Telegram/SourceFiles/export/data/export_data_types.cpp index f4c0c788da..830e64e907 100644 --- a/Telegram/SourceFiles/export/data/export_data_types.cpp +++ b/Telegram/SourceFiles/export/data/export_data_types.cpp @@ -1724,9 +1724,9 @@ File &Message::file() { } else if (const auto photo = std::get_if( content)) { return photo->photo.image.file; - } else if (const auto wallpaper = std::get_if( - content)) { - // #TODO wallpapers + // } else if (const auto wallpaper = std::get_if( + // content)) { + // #TODO wallpapers } return media.file(); } @@ -1738,9 +1738,9 @@ const File &Message::file() const { } else if (const auto photo = std::get_if( content)) { return photo->photo.image.file; - } else if (const auto wallpaper = std::get_if( - content)) { - // #TODO wallpapers + // } else if (const auto wallpaper = std::get_if( + // content)) { + // #TODO wallpapers } return media.file(); } diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 1eb7d91073..bde7012f1b 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -190,7 +190,7 @@ void History::itemVanished(not_null item) { setUnreadCount(unreadCount() - 1); } if (const auto media = item->media()) { - if (const auto gift = media->gift()) { + if (media->gift()) { using GiftAction = Data::GiftUpdate::Action; owner().notifyGiftUpdate({ .id = Data::SavedStarGiftId::User(item->id), @@ -1160,7 +1160,7 @@ void History::applyServiceChanges( auto paid = std::optional(); if (const auto message = payment->msg) { if (const auto media = message->media()) { - if (const auto invoice = media->invoice()) { + if (media->invoice()) { paid = Payments::CheckoutProcess::InvoicePaid( message); } @@ -2555,7 +2555,7 @@ auto History::computeChatListMessageFromLast() const if (!last || !last->isGroupMigrate()) { return _lastMessage; } - if (const auto chat = peer->asChat()) { + if (peer->isChat()) { // In chats we try to take the item before the 'last', which // is the empty-displayed migration message. if (!loadedAtBottom()) { @@ -2633,7 +2633,7 @@ void History::setFakeChatListMessage() { } } return; - } else if (const auto chat = peer->asChat()) { + } else if (peer->isChat()) { // In chats we try to take the item before the 'last', which // is the empty-displayed migration message. owner().histories().requestFakeChatListMessage(this); @@ -2876,10 +2876,8 @@ void History::dialogEntryApplied() { addOlderSlice(QVector()); if (const auto channel = peer->asChannel()) { const auto inviter = channel->inviter; - if (inviter && channel->amIn()) { - if (const auto from = owner().userLoaded(inviter)) { - insertJoinedMessage(); - } + if (inviter && channel->amIn() && owner().userLoaded(inviter)) { + insertJoinedMessage(); } } return; @@ -2890,10 +2888,9 @@ void History::dialogEntryApplied() { const auto inviter = channel->inviter; if (inviter && chatListTimeId() <= channel->inviteDate - && channel->amIn()) { - if (const auto from = owner().userLoaded(inviter)) { - insertJoinedMessage(); - } + && channel->amIn() + && owner().userLoaded(inviter)) { + insertJoinedMessage(); } } } diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 227c1a5fc9..606c788142 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2495,9 +2495,12 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { const auto itemId = item->fullId(); _menu->addAction(tr::lng_context_select_msg(tr::now), [=] { if (const auto item = session->data().message(itemId)) { - if (const auto view = viewByItem(item)) { + if ([[maybe_unused]] const auto view = viewByItem(item)) { if (asGroup) { - changeSelectionAsGroup(&_selected, item, SelectAction::Select); + changeSelectionAsGroup( + &_selected, + item, + SelectAction::Select); } else { changeSelection(&_selected, item, SelectAction::Select); } @@ -4628,7 +4631,7 @@ void HistoryInner::reportAsGroup(FullMsgId itemId) { } void HistoryInner::blockSenderItem(FullMsgId itemId) { - if (const auto item = session().data().message(itemId)) { + if ([[maybe_unused]] const auto item = session().data().message(itemId)) { _controller->show(Box( Window::BlockSenderFromRepliesBox, _controller, diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 927ea907a3..86861abed7 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -2263,7 +2263,7 @@ void HistoryItem::setRealId(MsgId newId) { _history->owner().groups().refreshMessage(this); _history->owner().requestItemResize(this); - if (const auto reply = Get()) { + if (Has()) { incrementReplyToTopCounter(); } @@ -2440,7 +2440,7 @@ bool HistoryItem::canDeleteForEveryone(TimeId now) const { bool HistoryItem::suggestReport() const { if (out() || isService() || !isRegular()) { return false; - } else if (const auto channel = _history->peer->asChannel()) { + } else if (_history->peer->isChannel()) { return true; } else if (const auto user = _history->peer->asUser()) { return user->isBot(); @@ -3731,7 +3731,7 @@ void HistoryItem::createComponents(CreateConfig &&config) { if (const auto via = Get()) { via->create(&_history->owner(), config.viaBotId); } - if (const auto views = Get()) { + if (Has()) { changeViewsCount(config.viewsCount); if (config.replies.isNull && isSending() diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index c0358488b4..974fdbd8b8 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -1208,7 +1208,7 @@ void ClearMediaAsExpired(not_null item) { ? tr::lng_ttl_round_expired : tr::lng_message_empty)(tr::now, Ui::Text::WithEntities); item->updateServiceText(PreparedServiceText{ std::move(text) }); - } else if (const auto photo = media->photo()) { + } else if (media->photo()) { item->applyEditionToHistoryCleared(); item->updateServiceText(PreparedServiceText{ tr::lng_ttl_photo_expired(tr::now, Ui::Text::WithEntities) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 1e2be03be0..4d34fd0b86 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -7416,7 +7416,7 @@ bool HistoryWidget::showSlowmodeError() { Ui::FormatDurationWordsSlowmode(left)); } else if (_peer->slowmodeApplied()) { if (const auto item = _history->latestSendingMessage()) { - if (const auto view = item->mainView()) { + if (item->mainView()) { animatedScrollToItem(item->id); enqueueMessageHighlight({ item }); } diff --git a/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp b/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp index 7502a93c88..44e059ff34 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp @@ -102,7 +102,7 @@ void ForwardPanel::checkTexts() { for (const auto item : _data.items) { if (const auto from = item->originalSender()) { version += from->nameVersion(); - } else if (const auto info = item->originalHiddenSenderInfo()) { + } else if (item->originalHiddenSenderInfo()) { ++version; } else { Unexpected("Corrupt forwarded information in message."); diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index e93a5c6faa..4d735d3d8e 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -198,7 +198,7 @@ ClickHandlerPtr BottomInfo::replayEffectLink( const auto weak = base::make_weak(view); return std::make_shared([=](ClickContext context) { const auto my = context.other.value(); - if (const auto controller = my.sessionWindow.get()) { + if ([[maybe_unused]] const auto controller = my.sessionWindow.get()) { if (const auto strong = weak.get()) { strong->delegate()->elementStartEffect(strong, nullptr); } diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index d1cead7548..b28099fe58 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -1440,11 +1440,11 @@ void AddSaveSoundForNotifications( return; } else if (int(ringtones.list().size()) >= ringtones.maxSavedCount()) { return; - } else if (const auto song = document->song()) { + } else if (document->song()) { if (document->duration() > ringtones.maxDuration()) { return; } - } else if (const auto voice = document->voice()) { + } else if (document->voice()) { if (document->duration() > ringtones.maxDuration()) { return; } diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 1daf0a1133..d70006e3f4 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -1489,7 +1489,7 @@ void ListWidget::cancelSelection() { void ListWidget::selectItem(not_null item) { if (hasSelectRestriction()) { return; - } else if (const auto view = viewForItem(item)) { + } else if ([[maybe_unused]] const auto view = viewForItem(item)) { clearTextSelection(); changeSelection( _selected, @@ -1502,7 +1502,7 @@ void ListWidget::selectItem(not_null item) { void ListWidget::selectItemAsGroup(not_null item) { if (hasSelectRestriction()) { return; - } else if (const auto view = viewForItem(item)) { + } else if ([[maybe_unused]] const auto view = viewForItem(item)) { clearTextSelection(); changeSelectionAsGroup( _selected, diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 591e8b37d4..4c76c50f57 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -2477,7 +2477,7 @@ bool Message::hasFromPhoto() const { return true; } else if (item->history()->peer->isVerifyCodes()) { return !hasOutLayout(); - } else if (const auto forwarded = item->Get()) { + } else if (item->Has()) { const auto peer = item->history()->peer; if (peer->isSelf() || peer->isRepliesChat()) { return !hasOutLayout(); @@ -3136,7 +3136,7 @@ void Message::updatePressed(QPoint point) { if (const auto reply = Get()) { trect.setTop(trect.top() + reply->height()); } - if (const auto via = item->Get()) { + if (item->Has()) { if (!displayFromName() && !displayForwardedFrom()) { trect.setTop(trect.top() + st::msgNameFont->height); } @@ -4447,7 +4447,7 @@ Ui::BubbleRounding Message::countMessageRounding() const { Ui::BubbleRounding Message::countBubbleRounding( Ui::BubbleRounding messageRounding) const { - if (const auto keyboard = data()->inlineReplyKeyboard()) { + if ([[maybe_unused]] const auto _ = data()->inlineReplyKeyboard()) { messageRounding.bottomLeft = messageRounding.bottomRight = Ui::BubbleCornerRounding::Small; diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index 62d5d43a94..2b25656355 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -738,7 +738,7 @@ void TopBarWidget::infoClicked() { return; } else if (const auto topic = key.topic()) { _controller->showSection(std::make_shared(topic)); - } else if (const auto sublist = key.sublist()) { + } else if ([[maybe_unused]] const auto sublist = key.sublist()) { _controller->showSection(std::make_shared( _controller->session().user(), Info::Section(Storage::SharedMediaType::Photo))); diff --git a/Telegram/SourceFiles/history/view/media/history_view_document.cpp b/Telegram/SourceFiles/history/view/media/history_view_document.cpp index 84f0668846..0c9521d4db 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_document.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_document.cpp @@ -271,10 +271,10 @@ void PaintWaveform( }; add(FormatDownloadText(document->size, document->size)); const auto duration = document->duration() / 1000; - if (const auto song = document->song()) { + if (document->song()) { add(FormatPlayedText(duration, duration)); add(FormatDurationAndSizeText(duration, document->size)); - } else if (const auto voice = document->voice() ? document->voice() : document->round()) { + } else if (document->voice() ? document->voice() : document->round()) { add(FormatPlayedText(duration, duration)); add(FormatDurationAndSizeText(duration, document->size)); } else if (document->isVideoFile()) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp index d27ef88168..bfac91b07d 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_generic.cpp @@ -448,7 +448,7 @@ void StickerInBubblePart::ensureCreated(Element *replacing) const { return; } else if (const auto data = _lookup()) { const auto sticker = data.sticker; - if (const auto info = sticker->sticker()) { + if (sticker->sticker()) { const auto skipPremiumEffect = true; _link = data.link; _skipTop = data.skipTop; diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp index f9a9b031ca..39679cb448 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp @@ -411,7 +411,7 @@ void PremiumGift::ensureStickerCreated() const { const auto count = credits(); const auto months = count ? packs.monthsForStars(count) : _data.count; if (const auto document = packs.lookup(months)) { - if (const auto sticker = document->sticker()) { + if (document->sticker()) { const auto skipPremiumEffect = false; _sticker.emplace(_parent, document, skipPremiumEffect, _parent); _sticker->setPlayingOnce(true); diff --git a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp index 409373713d..5d1772c93a 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_setup_widget.cpp @@ -751,7 +751,7 @@ void InnerWidget::setupEnd() { *sent = false; if (!success) { return; - } else if (const auto strong = weak.data()) { + } else if ([[maybe_unused]] const auto strong = weak.data()) { _controller->showBackFromStack(); window->showToast({ .title = tr::lng_star_ref_ended_title(tr::now), diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 26ca73fe3d..caa4ca26a9 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -861,7 +861,7 @@ rpl::producer AddCurrencyAction( ) | rpl::start_with_error_done([=](const QString &error) { currencyLoadLifetime->destroy(); }, [=] { - if (const auto strong = weak.data()) { + if ([[maybe_unused]] const auto strong = weak.data()) { state->balance = currencyLoad->data().currentBalance; currencyLoadLifetime->destroy(); } diff --git a/Telegram/SourceFiles/info/profile/info_profile_widget.cpp b/Telegram/SourceFiles/info/profile/info_profile_widget.cpp index 48b0107edf..6f62b98975 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_widget.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_widget.cpp @@ -100,7 +100,7 @@ void Widget::setInnerFocus() { } rpl::producer Widget::title() { - if (const auto topic = controller()->key().topic()) { + if (controller()->key().topic()) { return tr::lng_info_topic_title(); } const auto peer = controller()->key().peer(); diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index 7f6f415814..3778522acb 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -1582,11 +1582,11 @@ TextState Game::getState( } void Game::prepareThumbnail(QSize size) const { - if (const auto document = getResultDocument()) { + if ([[maybe_unused]] const auto document = getResultDocument()) { Assert(_documentMedia != nullptr); validateThumbnail(_documentMedia->thumbnail(), size, true); validateThumbnail(_documentMedia->thumbnailInline(), size, false); - } else if (const auto photo = getResultPhoto()) { + } else if ([[maybe_unused]] const auto photo = getResultPhoto()) { using Data::PhotoSize; Assert(_photoMedia != nullptr); validateThumbnail(_photoMedia->image(PhotoSize::Thumbnail), size, true); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index f4ba6983c5..d2437cfa46 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1166,7 +1166,7 @@ float64 MainWidget::chatBackgroundProgress() const { if (_background) { if (_background->generating) { return 1.; - } else if (const auto document = _background->data.document()) { + } else if (_background->data.document()) { return _background->dataMedia->progress(); } } @@ -2602,7 +2602,7 @@ auto MainWidget::thirdSectionForCurrentMainSection( return std::make_shared( peer, Info::Memento::DefaultSection(peer)); - } else if (const auto sublist = key.sublist()) { + } else if (key.sublist()) { return std::make_shared( session().user(), Info::Memento::DefaultSection(session().user())); diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index 6425b79513..89d85a5454 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -642,7 +642,7 @@ void Widget::updateTimeText(const TrackState &state) { display = state.position; } else if (state.length) { display = state.length; - } else if (const auto song = document->song()) { + } else if (document->song()) { display = (document->duration() * frequency) / 1000; } diff --git a/Telegram/SourceFiles/media/stories/media_stories_reply.cpp b/Telegram/SourceFiles/media/stories/media_stories_reply.cpp index 4587335876..1ba70c7fd5 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_reply.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_reply.cpp @@ -905,8 +905,7 @@ bool ReplyArea::showSlowmodeError() { lt_left, Ui::FormatDurationWordsSlowmode(left)); } else if (peer->slowmodeApplied()) { - const auto history = peer->owner().history(peer); - if (const auto item = history->latestSendingMessage()) { + if (peer->owner().history(peer)->latestSendingMessage()) { return tr::lng_slowmode_no_many(tr::now); } } diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 05e1c0ad78..af3317ca02 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -1017,7 +1017,7 @@ const style::RoundCheckbox &Voice::checkboxStyle() const { } void Voice::updateName() { - if (const auto forwarded = parent()->Get()) { + if (parent()->Has()) { const auto info = parent()->originalHiddenSenderInfo(); const auto name = info ? tr::lng_forwarded(tr::now, lt_user, info->nameText().toString()) diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 9aee9306f5..8b9a08cd95 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -1895,7 +1895,7 @@ void GenericCreditsEntryBox( ProcessReceivedSubscriptions(weak, session); }; const auto fail = [=, show = box->uiShow()](const QString &e) { - if (const auto strong = weak.data()) { + if ([[maybe_unused]] const auto strong = weak.data()) { state->confirmButtonBusy = false; } show->showToast(e); diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index 995591894e..bd5d8be137 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -911,7 +911,7 @@ void SetupTagContent( const auto send = [=, weak = Ui::MakeWeak(tagsButton)](bool checked) { session->data().chatsFilters().requestToggleTags(checked, [=] { - if (const auto strong = weak.data()) { + if ([[maybe_unused]] const auto strong = weak.data()) { state->tagsTurnOff.fire(!checked); } }); diff --git a/Telegram/SourceFiles/storage/file_download_web.cpp b/Telegram/SourceFiles/storage/file_download_web.cpp index 1c56d8b063..ddac1f8436 100644 --- a/Telegram/SourceFiles/storage/file_download_web.cpp +++ b/Telegram/SourceFiles/storage/file_download_web.cpp @@ -418,7 +418,7 @@ void WebLoadManager::failed( } void WebLoadManager::failed(int id, not_null reply) { - if (const auto sent = findSent(id, reply)) { + if ([[maybe_unused]] const auto sent = findSent(id, reply)) { removeSent(id); queueFailedUpdate(id); } diff --git a/Telegram/SourceFiles/storage/storage_media_prepare.cpp b/Telegram/SourceFiles/storage/storage_media_prepare.cpp index 290fae458b..588d901440 100644 --- a/Telegram/SourceFiles/storage/storage_media_prepare.cpp +++ b/Telegram/SourceFiles/storage/storage_media_prepare.cpp @@ -319,7 +319,7 @@ void PrepareDetails(PreparedFile &file, int previewWidth, int sideLimit) { file.preview.setDevicePixelRatio(style::DevicePixelRatio()); file.type = PreparedFile::Type::Video; } - } else if (const auto song = std::get_if(&file.information->media)) { + } else if (v::is(file.information->media)) { file.type = PreparedFile::Type::Music; } } diff --git a/Telegram/SourceFiles/ui/chat/group_call_userpics.cpp b/Telegram/SourceFiles/ui/chat/group_call_userpics.cpp index 4044c7d26f..f415151c2f 100644 --- a/Telegram/SourceFiles/ui/chat/group_call_userpics.cpp +++ b/Telegram/SourceFiles/ui/chat/group_call_userpics.cpp @@ -241,7 +241,7 @@ void GroupCallUserpics::sendRandomLevels() { for (auto &userpic : _list) { if (const auto blobs = userpic.blobsAnimation.get()) { const auto value = 30 + base::RandomIndex(70); - userpic.blobsAnimation->blobs.setLevel(float64(value) / 100.); + blobs->blobs.setLevel(float64(value) / 100.); } } } diff --git a/Telegram/SourceFiles/ui/effects/reaction_fly_animation.cpp b/Telegram/SourceFiles/ui/effects/reaction_fly_animation.cpp index a193bf32db..239a1e5456 100644 --- a/Telegram/SourceFiles/ui/effects/reaction_fly_animation.cpp +++ b/Telegram/SourceFiles/ui/effects/reaction_fly_animation.cpp @@ -385,10 +385,10 @@ int ReactionFlyAnimation::computeParabolicTop( void ReactionFlyAnimation::startAnimations() { if (const auto center = _center.get()) { - _center->animate(callback()); + center->animate(callback()); } if (const auto effect = _effect.get()) { - _effect->animate(callback()); + effect->animate(callback()); } else if (_scaleOutDuration > 0) { _noEffectScaleStarted = true; _noEffectScaleAnimation.start(callback(), 1, 0, _scaleOutDuration); diff --git a/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_slider.cpp b/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_slider.cpp index 5fddc9e797..be0a808e59 100644 --- a/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_slider.cpp +++ b/Telegram/SourceFiles/ui/widgets/chat_filters_tabs_slider.cpp @@ -378,7 +378,7 @@ void ChatsFiltersTabs::setHorizontalShift(int index, int shift) { Expects(index >= 0 && index < _sections.size()); auto §ion = _sections[index]; - if (const auto delta = shift - section.horizontalShift) { + if (shift - section.horizontalShift) { section.horizontalShift = shift; update(); } diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index a0dbbfc583..d8e6f452f9 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -585,7 +585,7 @@ void Filler::addStoryArchive() { const auto controller = _controller; const auto weak = base::make_weak(_thread); _addAction(tr::lng_stories_archive_button(tr::now), [=] { - if (const auto strong = weak.get()) { + if ([[maybe_unused]] const auto strong = weak.get()) { controller->showSection(Info::Stories::Make( channel, Info::Stories::Tab::Archive)); @@ -1096,7 +1096,7 @@ void Filler::addViewStatistics() { = (channel->flags() & Flag::CanViewCreditsRevenue); if (canGetStats) { _addAction(tr::lng_stats_title(tr::now), [=] { - if (const auto strong = weak.get()) { + if ([[maybe_unused]] const auto strong = weak.get()) { using namespace Info; controller->showSection(Statistics::Make(peer, {}, {})); } @@ -1106,14 +1106,14 @@ void Filler::addViewStatistics() { || channel->amCreator() || channel->canPostStories()) { _addAction(tr::lng_boosts_title(tr::now), [=] { - if (const auto strong = weak.get()) { + if ([[maybe_unused]] const auto strong = weak.get()) { controller->showSection(Info::Boosts::Make(peer)); } }, &st::menuIconBoosts); } if (canViewEarn || canViewCreditsEarn) { _addAction(tr::lng_channel_earn_title(tr::now), [=] { - if (const auto strong = weak.get()) { + if ([[maybe_unused]] const auto strong = weak.get()) { controller->showSection(Info::ChannelEarn::Make(peer)); } }, &st::menuIconEarn);