From ba9b72e038ed9bb48b825d372090b369f81bd3f2 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 14 Jul 2021 02:16:03 +0400 Subject: [PATCH] Fix -Wunused-variable warnings with gcc --- Telegram/SourceFiles/boxes/language_box.cpp | 4 +- .../boxes/peers/edit_peer_type_box.cpp | 17 --------- .../SourceFiles/boxes/sticker_set_box.cpp | 1 - .../calls/group/calls_choose_join_as.cpp | 1 - .../calls/group/calls_group_members.cpp | 15 -------- .../chat_helpers/gifs_list_widget.cpp | 2 - .../chat_helpers/stickers_list_widget.cpp | 1 - Telegram/SourceFiles/core/shortcuts.h | 2 +- .../data/data_document_resolver.cpp | 38 ++++++++++--------- .../dialogs/dialogs_inner_widget.cpp | 2 - .../admin_log/history_admin_log_filter.cpp | 11 ------ .../admin_log/history_admin_log_inner.cpp | 2 +- .../history/history_inner_widget.cpp | 2 +- .../history/view/media/history_view_call.cpp | 3 +- .../info/media/info_media_inner_widget.cpp | 4 +- .../info/profile/info_profile_actions.cpp | 1 - .../inline_bots/inline_bot_layout_item.cpp | 2 +- .../inline_bots/inline_results_inner.cpp | 2 - .../media/player/media_player_widget.cpp | 5 +-- .../media/view/media_view_overlay_widget.cpp | 7 ++-- .../mtproto/details/mtproto_dc_key_binder.cpp | 1 - .../mtproto/mtproto_concurrent_sender.h | 8 ++-- .../mtproto/mtproto_dc_options.cpp | 4 +- .../platform/linux/linux_xdp_file_dialog.cpp | 29 +------------- .../SourceFiles/settings/settings_intro.cpp | 7 ---- .../SourceFiles/ui/boxes/choose_date_time.cpp | 9 ----- Telegram/SourceFiles/ui/empty_userpic.cpp | 2 +- Telegram/SourceFiles/window/main_window.cpp | 4 -- .../themes/window_theme_editor_block.cpp | 2 +- .../window/themes/window_theme_preview.cpp | 6 +-- .../window/window_outdated_bar.cpp | 2 +- 31 files changed, 46 insertions(+), 150 deletions(-) diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index a14dbeb5f..baf3ac1a0 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -115,12 +115,12 @@ private: const Rows::Row &rowBySelection(Selection selected) const; std::unique_ptr &rippleBySelection( Selection selected); - const std::unique_ptr &rippleBySelection( + [[maybe_unused]] const std::unique_ptr &rippleBySelection( Selection selected) const; std::unique_ptr &rippleBySelection( not_null row, Selection selected); - const std::unique_ptr &rippleBySelection( + [[maybe_unused]] const std::unique_ptr &rippleBySelection( not_null row, Selection selected) const; void addRipple(Selection selected, QPoint position); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp index d18977597..ff7a754aa 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp @@ -129,9 +129,6 @@ private: const QString &text, rpl::producer about); - bool inviteLinkShown(); - QString inviteLinkText(); - not_null _peer; bool _linkOnly = false; @@ -308,15 +305,6 @@ QString Controller::getUsernameInput() { return _controls.usernameInput->getLastText().trimmed(); } -QString Controller::inviteLinkText() { - if (const auto channel = _peer->asChannel()) { - return channel->inviteLink(); - } else if (const auto chat = _peer->asChat()) { - return chat->inviteLink(); - } - return QString(); -} - object_ptr Controller::createUsernameEdit() { Expects(_wrap != nullptr); @@ -583,11 +571,6 @@ object_ptr Controller::createInviteLinkBlock() { return result; } -bool Controller::inviteLinkShown() { - return !_controls.privacy - || (_controls.privacy->value() == Privacy::NoUsername); -} - } // namespace EditPeerTypeBox::EditPeerTypeBox( diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 74c3a84dd..74f37c61d 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -761,7 +761,6 @@ void StickerSetBox::Inner::visibleTopBottomUpdated( void StickerSetBox::Inner::setupLottie(int index) { auto &element = _elements[index]; - const auto document = element.document; element.animated = ChatHelpers::LottieAnimationFromDocument( getLottiePlayer(), diff --git a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp index db1e6a3bb..cefaca113 100644 --- a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp +++ b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp @@ -335,7 +335,6 @@ void ChooseJoinAsProcess::start( }, _request->lifetime); const auto finish = [=](JoinInfo info) { - const auto peer = _request->peer; const auto done = std::move(_request->done); const auto box = _request->box; _request = nullptr; diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index f7e9fd3fd..c82fbb403 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -1171,21 +1171,6 @@ int Members::Controller::rowPaintStatusIcon( : state.raisedHand ? st::groupCallMemberInactiveStatus->c : iconColor; - const auto color = (state.speaking == 1. && !state.mutedByMe) - ? st::groupCallMemberActiveStatus->c - : (state.speaking == 0. - ? (state.active == 1. - ? st::groupCallMemberNotJoinedStatus->c - : (state.active == 0. - ? (state.muted == 1. - ? (state.raisedHand - ? st::groupCallMemberInactiveStatus->c - : st::groupCallMemberNotJoinedStatus->c) - : (state.muted == 0. - ? st::groupCallMemberNotJoinedStatus->c - : other)) - : other)) - : other); if (camera) { st::groupCallNarrowCameraIcon.paint(p, x, y, outerWidth, other); x += st::groupCallNarrowCameraIcon.width(); diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index fa8c42294..35fe93f55 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -1033,7 +1033,6 @@ void GifsListWidget::updateSelected() { int row = -1, col = -1, sel = -1; ClickHandlerPtr lnk; ClickHandlerHost *lnkhost = nullptr; - HistoryView::CursorState cursor = HistoryView::CursorState::None; if (sy >= 0) { row = 0; for (int rows = _rows.size(); row < rows; ++row) { @@ -1062,7 +1061,6 @@ void GifsListWidget::updateSelected() { QPoint(sx, sy), HistoryView::StateRequest()); lnk = result.link; - cursor = result.cursor; lnkhost = inlineItems[col]; } else { row = col = -1; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index a9eb774b5..f2dcd6f42 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -1880,7 +1880,6 @@ void StickersListWidget::ensureLottiePlayer(Set &set) { void StickersListWidget::setupLottie(Set &set, int section, int index) { auto &sticker = set.stickers[index]; - const auto document = sticker.document; ensureLottiePlayer(set); // Document should be loaded already for the animation to be set up. diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index c6a8b596a..ef1d16486 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -63,7 +63,7 @@ enum class Command { SupportHistoryForward, }; -constexpr auto kShowFolder = { +[[maybe_unused]] constexpr auto kShowFolder = { Command::ShowAllChats, Command::ShowFolder1, Command::ShowFolder2, diff --git a/Telegram/SourceFiles/data/data_document_resolver.cpp b/Telegram/SourceFiles/data/data_document_resolver.cpp index 9588cea4b..8452af7fd 100644 --- a/Telegram/SourceFiles/data/data_document_resolver.cpp +++ b/Telegram/SourceFiles/data/data_document_resolver.cpp @@ -98,25 +98,27 @@ QString FileExtension(const QString &filepath) { return QString(last.base(), last - reversed.begin()); } -// bool IsValidMediaFile(const QString &filepath) { -// static const auto kExtensions = [] { -// const auto list = qsl("\ -// 16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \ -// avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \ -// dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \ -// ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \ -// mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \ -// niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \ -// qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \ -// swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \ -// wv xm xml ym yuv").split(' '); -// return base::flat_set(list.begin(), list.end()); -// }(); +#if 0 +bool IsValidMediaFile(const QString &filepath) { + static const auto kExtensions = [] { + const auto list = qsl("\ +16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \ +avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \ +dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \ +ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \ +mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \ +niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \ +qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \ +swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \ +wv xm xml ym yuv").split(' '); + return base::flat_set(list.begin(), list.end()); + }(); -// return ranges::binary_search( -// kExtensions, -// FileExtension(filepath).toLower()); -// } + return ranges::binary_search( + kExtensions, + FileExtension(filepath).toLower()); +} +#endif bool IsExecutableName(const QString &filepath) { static const auto kExtensions = [] { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 2e8128349..fe4f58229 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -1248,14 +1248,12 @@ bool InnerWidget::pinnedShiftAnimationCallback(crl::time now) { now += st::stickersRowDuration; } - auto wasAnimating = false; auto animating = false; auto updateMin = -1; auto updateMax = 0; for (auto i = 0, l = static_cast(_pinnedRows.size()); i != l; ++i) { auto start = _pinnedRows[i].animStartTime; if (start) { - wasAnimating = true; if (updateMin < 0) updateMin = i; updateMax = i; if (start + st::stickersRowDuration > now && now >= start) { diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp index 7f1c688b9..579b888c4 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp @@ -32,7 +32,6 @@ public: return _check->checked(); } rpl::producer checkedChanges() const; - rpl::producer checkedValue() const; enum class NotifyAboutChange { Notify, @@ -42,8 +41,6 @@ public: bool checked, NotifyAboutChange notify = NotifyAboutChange::Notify); - void finishAnimating(); - QMargins getMargins() const override { return _st.margin; } @@ -90,10 +87,6 @@ rpl::producer UserCheckbox::checkedChanges() const { return _checkedChanges.events(); } -rpl::producer UserCheckbox::checkedValue() const { - return _checkedChanges.events_starting_with(checked()); -} - void UserCheckbox::setChecked(bool checked, NotifyAboutChange notify) { if (_check->checked() != checked) { _check->setChecked(checked, anim::type::normal); @@ -133,10 +126,6 @@ void UserCheckbox::paintEvent(QPaintEvent *e) { p.drawTextLeft(statusLeft, statusTop, width(), _statusText); } -void UserCheckbox::finishAnimating() { - _check->finishAnimating(); -} - int UserCheckbox::resizeGetHeight(int newWidth) { return st::contactsPhotoSize; } 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 40a454332..387ce6f46 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -1637,7 +1637,7 @@ void InnerWidget::updateSelected() { dragState = view->textState(itemPoint, request); lnkhost = view; if (!dragState.link && itemPoint.x() >= st::historyPhotoLeft && itemPoint.x() < st::historyPhotoLeft + st::msgPhotoSize) { - if (auto message = item->toHistoryMessage()) { + if (item->toHistoryMessage()) { if (view->hasFromPhoto()) { enumerateUserpics([&](not_null view, int userpicTop) { // stop enumeration if the userpic is below our point diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 11eae477d..a351ec98b 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2823,7 +2823,7 @@ void HistoryInner::mouseActionUpdate() { _dragStateItem = session().data().message(dragState.itemId); lnkhost = view; if (!dragState.link && m.x() >= st::historyPhotoLeft && m.x() < st::historyPhotoLeft + st::msgPhotoSize) { - if (auto msg = item->toHistoryMessage()) { + if (item->toHistoryMessage()) { if (view->hasFromPhoto()) { enumerateUserpics([&](not_null view, int userpicTop) -> bool { // stop enumeration if the userpic is below our point diff --git a/Telegram/SourceFiles/history/view/media/history_view_call.cpp b/Telegram/SourceFiles/history/view/media/history_view_call.cpp index 3722a015d..6ce9be5f6 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_call.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_call.cpp @@ -81,12 +81,11 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m accumulate_min(paintw, maxWidth()); - auto nameleft = 0, nametop = 0, nameright = 0, statustop = 0; + auto nameleft = 0, nametop = 0, statustop = 0; auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus; nameleft = st::historyCallLeft; nametop = st::historyCallTop - topMinus; - nameright = st::msgFileLayout.padding.left(); statustop = st::historyCallStatusTop - topMinus; p.setFont(st::semiboldFont); diff --git a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp index d76a43575..3ea25dddd 100644 --- a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp @@ -125,9 +125,9 @@ void InnerWidget::createTypeButtons() { addMediaButton(Type::MusicFile, st::infoIconMediaAudio); addMediaButton(Type::Link, st::infoIconMediaLink); addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice); - if (auto user = _controller->key().peer()->asUser()) { +// if (auto user = _controller->key().peer()->asUser()) { // addCommonGroupsButton(user, st::infoIconMediaGroup); - } +// } content->add(object_ptr( content, diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 20964ce55..516146bb9 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -458,7 +458,6 @@ ActionsFiller::ActionsFiller( void ActionsFiller::addInviteToGroupAction( not_null user) { - const auto controller = _controller; AddActionButton( _wrap, tr::lng_profile_invite_to_group(), diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp index 84593fa81..a8b9b2a57 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp @@ -198,7 +198,7 @@ ClickHandlerPtr ItemBase::getResultPreviewHandler() const { _result->_content_url, false); } else if (const auto document = _result->_document - && _result->_document->createMediaView()->canBePlayed()) { + ; document->createMediaView()->canBePlayed()) { return std::make_shared(); } else if (_result->_photo) { return std::make_shared(); diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index cb8b225ee..2b76bd072 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -677,7 +677,6 @@ void Inner::updateSelected() { int row = -1, col = -1, sel = -1; ClickHandlerPtr lnk; ClickHandlerHost *lnkhost = nullptr; - HistoryView::CursorState cursor = HistoryView::CursorState::None; if (sy >= 0) { row = 0; for (int rows = _rows.size(); row < rows; ++row) { @@ -706,7 +705,6 @@ void Inner::updateSelected() { QPoint(sx, sy), HistoryView::StateRequest()); lnk = result.link; - cursor = result.cursor; lnkhost = inlineItems[col]; } else { row = col = -1; diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index a0204515f..d3518fa39 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -478,12 +478,11 @@ void Widget::handleSongUpdate(const TrackState &state) { } void Widget::updateTimeText(const TrackState &state) { - qint64 position = 0, length = 0, display = 0; + qint64 display = 0; const auto frequency = state.frequency; const auto document = state.id.audio(); if (!IsStoppedOrStopping(state.state)) { - display = position = state.position; - length = state.length; + display = state.position; } else if (state.length) { display = state.length; } else if (const auto song = document->song()) { diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index b10e583ea..f288e9c22 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2439,7 +2439,7 @@ void OverlayWidget::displayDocument( _docIconRect = QRect((width() - st::mediaviewFileIconSize) / 2, (height() - st::mediaviewFileIconSize) / 2, st::mediaviewFileIconSize, st::mediaviewFileIconSize); int32 colorIndex = documentColorIndex(_document, _docExt); _docIconColor = documentColor(colorIndex); - const style::icon *(thumbs[]) = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow }; + const style::icon *thumbs[] = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow }; _docIcon = thumbs[colorIndex]; int32 extmaxw = (st::mediaviewFileIconSize - st::mediaviewFileExtPadding * 2); @@ -3429,7 +3429,7 @@ void OverlayWidget::paintThemePreviewContent( width(), st::themePreviewMargin.top()); } - if (const auto fillTitleRect = (titleRect.y() < 0)) { + if (titleRect.y() < 0) { titleRect.moveTop(0); fillOverlay(titleRect); } @@ -3457,8 +3457,7 @@ void OverlayWidget::paintThemePreviewContent( outer.y() + outer.height() - st::themePreviewMargin.bottom(), outer.width(), st::themePreviewMargin.bottom()); - if (const auto fillButtonsRect - = (buttonsRect.y() + buttonsRect.height() > height())) { + if (buttonsRect.y() + buttonsRect.height() > height()) { buttonsRect.moveTop(height() - buttonsRect.height()); fillOverlay(buttonsRect); } diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp index db7a06ce8..2ade496b9 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp @@ -109,7 +109,6 @@ DcKeyBindState DcKeyBinder::handleResponse(const mtpBuffer &response) { auto from = response.begin(); const auto end = from + response.size(); auto error = MTPRpcError(); - auto result = MTPBool(); if (response[0] == mtpc_boolTrue) { return DcKeyBindState::Success; } else if (response[0] == mtpc_rpc_error && error.read(from, end)) { diff --git a/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h b/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h index d82f588eb..47daaf7a6 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h +++ b/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h @@ -314,10 +314,10 @@ auto ConcurrentSender::SpecificRequestBuilder::done( Handler, mtpRequestId, Result>; - constexpr auto takesResponse = rpl::details::is_callable_plain_v< + [[maybe_unused]] constexpr auto takesResponse = rpl::details::is_callable_plain_v< Handler, Result>; - constexpr auto takesNone = rpl::details::is_callable_plain_v; + [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v; if constexpr (takesFull) { setDoneHandler(std::forward(handler)); @@ -348,10 +348,10 @@ auto ConcurrentSender::SpecificRequestBuilder::fail( Handler, mtpRequestId, Error>; - constexpr auto takesError = rpl::details::is_callable_plain_v< + [[maybe_unused]] constexpr auto takesError = rpl::details::is_callable_plain_v< Handler, Error>; - constexpr auto takesNone = rpl::details::is_callable_plain_v; + [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v; if constexpr (takesFull) { setFailHandler(std::forward(handler)); diff --git a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp index 7458a7ba3..26862b6df 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp @@ -58,7 +58,7 @@ const BuiltInDc kBuiltInDcsIPv6Test[] = { { 3, "2001:0b28:f23d:f003:0000:0000:0000:000e", 443 } }; -const char *(kTestPublicRSAKeys[]) = { "\ +const char *kTestPublicRSAKeys[] = { "\ -----BEGIN RSA PUBLIC KEY-----\n\ MIIBCgKCAQEAyMEdY1aR+sCR3ZSJrtztKTKqigvO/vBfqACJLZtS7QMgCGXJ6XIR\n\ yy7mx66W0/sOFa7/1mAZtEoIokDP3ShoqF4fVNb6XeqgQfaUHd8wJpDWHcR2OFwv\n\ @@ -68,7 +68,7 @@ aHWfYmlEGepfaYR8Q0YqvvhYtMte3ITnuSJs171+GDqpdKcSwHnd6FudwGO4pcCO\n\ j4WcDuXc2CTHgH8gFTNhp/Y8/SpDOhvn9QIDAQAB\n\ -----END RSA PUBLIC KEY-----" }; -const char *(kPublicRSAKeys[]) = { "\ +const char *kPublicRSAKeys[] = { "\ -----BEGIN RSA PUBLIC KEY-----\n\ MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n\ 5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n\ diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp index c015e889e..fa34ba91c 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp @@ -176,20 +176,14 @@ public: } } - bool defaultNameFilterDisables() const; QUrl directory() const; void setDirectory(const QUrl &directory); void selectFile(const QUrl &filename); QList selectedFiles() const; - void setFilter(); - void selectNameFilter(const QString &filter); - QString selectedNameFilter() const; - void selectMimeTypeFilter(const QString &filter); - QString selectedMimeTypeFilter() const; int exec() override; - bool failedToOpen() { + bool failedToOpen() const { return _failedToOpen; } @@ -517,10 +511,6 @@ void XDPFileDialog::openPortal() { } } -bool XDPFileDialog::defaultNameFilterDisables() const { - return false; -} - void XDPFileDialog::setDirectory(const QUrl &directory) { _directory = directory.path().toStdString(); } @@ -544,23 +534,6 @@ QList XDPFileDialog::selectedFiles() const { return files; } -void XDPFileDialog::setFilter() { -} - -void XDPFileDialog::selectMimeTypeFilter(const QString &filter) { -} - -QString XDPFileDialog::selectedMimeTypeFilter() const { - return QString::fromStdString(_selectedMimeTypeFilter); -} - -void XDPFileDialog::selectNameFilter(const QString &filter) { -} - -QString XDPFileDialog::selectedNameFilter() const { - return QString::fromStdString(_selectedNameFilter); -} - int XDPFileDialog::exec() { setAttribute(Qt::WA_DeleteOnClose, false); diff --git a/Telegram/SourceFiles/settings/settings_intro.cpp b/Telegram/SourceFiles/settings/settings_intro.cpp index bf0053b48..e214b5c3e 100644 --- a/Telegram/SourceFiles/settings/settings_intro.cpp +++ b/Telegram/SourceFiles/settings/settings_intro.cpp @@ -49,7 +49,6 @@ protected: private: void updateControlsGeometry(int newWidth); Ui::RpWidget *pushButton(base::unique_qptr button); - void removeButton(not_null button); const style::InfoTopBar &_st; std::vector> _buttons; @@ -136,12 +135,6 @@ Ui::RpWidget *TopBar::pushButton(base::unique_qptr button) { return weak; } -void TopBar::removeButton(not_null button) { - _buttons.erase( - std::remove(_buttons.begin(), _buttons.end(), button), - _buttons.end()); -} - int TopBar::resizeGetHeight(int newWidth) { updateControlsGeometry(newWidth); return _st.height; diff --git a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp index 58af031ab..482826e55 100644 --- a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp +++ b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp @@ -126,7 +126,6 @@ private: void setInnerFocus(); void putNext(const object_ptr &field, QChar ch); void erasePrevious(const object_ptr &field); - void finishInnerAnimating(); void setErrorShown(bool error); void setFocused(bool focused); void startBorderAnimation(); @@ -538,14 +537,6 @@ void TimeInput::setFocused(bool focused) { } } -void TimeInput::finishInnerAnimating() { - _hour->finishAnimating(); - _minute->finishAnimating(); - _a_borderOpacity.stop(); - _a_borderShown.stop(); - _a_error.stop(); -} - void TimeInput::startBorderAnimation() { auto borderVisible = (_error || _focused); if (_borderVisible != borderVisible) { diff --git a/Telegram/SourceFiles/ui/empty_userpic.cpp b/Telegram/SourceFiles/ui/empty_userpic.cpp index ed3190136..b24995036 100644 --- a/Telegram/SourceFiles/ui/empty_userpic.cpp +++ b/Telegram/SourceFiles/ui/empty_userpic.cpp @@ -412,7 +412,7 @@ void EmptyUserpic::fillString(const QString &name) { auto ch = name.constData(), end = ch + name.size(); while (ch != end) { auto emojiLength = 0; - if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { + if (Ui::Emoji::Find(ch, end, &emojiLength)) { ch += emojiLength; } else if (ch->isHighSurrogate()) { ++ch; diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 4ac93f8f1..4c3eeca0d 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -491,11 +491,9 @@ void MainWindow::initSize() { } const auto primaryScreen = QGuiApplication::primaryScreen(); - auto geometryScreen = primaryScreen; const auto available = primaryScreen ? primaryScreen->availableGeometry() : QRect(0, 0, st::windowDefaultWidth, st::windowDefaultHeight); - bool maximized = false; const auto initialWidth = Core::Settings::ThirdColumnByDefault() ? st::windowBigDefaultWidth : st::windowDefaultWidth; @@ -561,13 +559,11 @@ void MainWindow::initSize() { position.y + st::windowMinHeight <= screenGeometry.y() + screenGeometry.height()) { DEBUG_LOG(("Window Pos: Resulting geometry is %1, %2, %3, %4").arg(position.x).arg(position.y).arg(position.w).arg(position.h)); geometry = QRect(position.x, position.y, position.w, position.h); - geometryScreen = screen; } } break; } } - maximized = position.maximized; } geometry += _padding; DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height())); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index 67fba5b31..9212e21e6 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -320,7 +320,7 @@ bool EditorBlock::selectSkip(int direction) { if (newSelected < -1 || newSelected > maxSelected) { newSelected = maxSelected; } - if (auto changed = (newSelected != _selected)) { + if (newSelected != _selected) { setSelected(newSelected); scrollToSelected(); return (newSelected >= 0); diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index 484dff0bf..82c3a7a7f 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -31,7 +31,7 @@ QString fillLetters(const QString &name) { auto ch = name.constData(), end = ch + name.size(); while (ch != end) { auto emojiLength = 0; - if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { + if (Ui::Emoji::Find(ch, end, &emojiLength)) { ch += emojiLength; } else if (ch->isHighSurrogate()) { ++ch; @@ -243,10 +243,8 @@ void Generator::addAudioBubble(QVector waveform, int waveactive, QString wa auto skipBlock = computeSkipBlock(status, date); auto width = st::msgFileMinWidth; - auto tleft = 0, tright = 0; const auto &st = st::msgFileLayout; - tleft = st.padding.left() + st.thumbSize + st.padding.right(); - tright = st.padding.left(); + auto tleft = st.padding.left() + st.thumbSize + st.padding.right(); accumulate_max(width, tleft + st::normalFont->width(wavestatus) + skipBlock.width() + st::msgPadding.right()); accumulate_min(width, st::msgMaxWidth); diff --git a/Telegram/SourceFiles/window/window_outdated_bar.cpp b/Telegram/SourceFiles/window/window_outdated_bar.cpp index ab1a6e9f3..df1b10b2d 100644 --- a/Telegram/SourceFiles/window/window_outdated_bar.cpp +++ b/Telegram/SourceFiles/window/window_outdated_bar.cpp @@ -22,6 +22,7 @@ constexpr auto kMinimalSkip = 7; constexpr auto kSoonSkip = 30; constexpr auto kNowSkip = 90; +#ifdef DESKTOP_APP_SPECIAL_TARGET class Bar : public Ui::RpWidget { public: Bar(not_null parent, QDate date); @@ -96,7 +97,6 @@ void Bar::paintEvent(QPaintEvent *e) { _soon ? st::outdateSoonBg : st::outdatedBg); } -#ifdef DESKTOP_APP_SPECIAL_TARGET QString LastHiddenPath() { return cWorkingDir() + qsl("tdata/outdated_hidden"); }