From ae0b9141dd7f73c27cab87ce467a09132e8dd030 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 14 Mar 2021 00:08:07 +0400 Subject: [PATCH] Trying to get rid of unused variables... --- Telegram/SourceFiles/boxes/language_box.cpp | 1 - Telegram/SourceFiles/boxes/passcode_box.cpp | 2 -- Telegram/SourceFiles/boxes/sticker_set_box.cpp | 1 - Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp | 1 - Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp | 2 +- Telegram/SourceFiles/core/crash_report_window.cpp | 1 - Telegram/SourceFiles/core/update_checker.cpp | 1 - .../history/view/controls/history_view_compose_controls.cpp | 2 -- Telegram/SourceFiles/info/media/info_media_list_widget.cpp | 2 +- Telegram/SourceFiles/inline_bots/inline_results_widget.cpp | 2 +- Telegram/SourceFiles/media/player/media_player_float.cpp | 2 +- Telegram/SourceFiles/media/player/media_player_widget.cpp | 1 - Telegram/SourceFiles/mtproto/session_private.cpp | 1 - Telegram/SourceFiles/ui/countryinput.cpp | 2 +- Telegram/SourceFiles/ui/filter_icon_panel.cpp | 2 +- Telegram/SourceFiles/window/main_window.cpp | 4 ++-- 16 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index 87ad7c2892..d421458376 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -464,7 +464,6 @@ void Rows::showMenu(int index) { Fn callback) { return _menu->addAction(text, std::move(callback)); }; - const auto id = row->data.id; if (canShare(row)) { addAction(tr::lng_proxy_edit_share(tr::now), [=] { share(row); }); } diff --git a/Telegram/SourceFiles/boxes/passcode_box.cpp b/Telegram/SourceFiles/boxes/passcode_box.cpp index 10c0f49b41..bf664d060d 100644 --- a/Telegram/SourceFiles/boxes/passcode_box.cpp +++ b/Telegram/SourceFiles/boxes/passcode_box.cpp @@ -695,8 +695,6 @@ bool PasscodeBox::handleCustomCheckError(const MTP::Error &error) { void PasscodeBox::sendClearCloudPassword( const Core::CloudPasswordResult &check) { - const auto newPasswordData = QByteArray(); - const auto newPasswordHash = QByteArray(); const auto hint = QString(); const auto email = QString(); const auto flags = MTPDaccount_passwordInputSettings::Flag::f_new_algo diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 3ade84faee..5fbec8d49e 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -566,7 +566,6 @@ int32 StickerSetBox::Inner::stickerFromGlobalPos(const QPoint &p) const { } void StickerSetBox::Inner::paintEvent(QPaintEvent *e) { - QRect r(e->rect()); Painter p(this); if (_elements.empty()) { diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index 0e5f123ec6..ee32abafa7 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -406,7 +406,6 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) { mrows.push_back({ i->second }); } } else if (_channel && _channel->isMegagroup()) { - QMultiMap ordered; if (_channel->lastParticipantsRequestNeeded()) { _channel->session().api().requestLastParticipants(_channel); } else { diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp index bb946ec44b..189c8ec18f 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp @@ -348,7 +348,7 @@ QImage TabbedPanel::grabForAnimation() { _a_show = base::take(showAnimation); _showAnimation = base::take(showAnimationData); _a_opacity = base::take(opacityAnimation); - _cache = base::take(_cache); + _cache = base::take(cache); return result; } diff --git a/Telegram/SourceFiles/core/crash_report_window.cpp b/Telegram/SourceFiles/core/crash_report_window.cpp index c37a060260..d3f75ae6cc 100644 --- a/Telegram/SourceFiles/core/crash_report_window.cpp +++ b/Telegram/SourceFiles/core/crash_report_window.cpp @@ -786,7 +786,6 @@ void LastCrashedWindow::updateControls() { h += _networkSettings.height() + padding; } - QRect scr(QApplication::primaryScreen()->availableGeometry()); QSize s(2 * padding + QFontMetrics(_label.font()).horizontalAdvance(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); if (s == size()) { resizeEvent(0); diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 90fcb54b3c..a07e29d251 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -250,7 +250,6 @@ QString ExtractFilename(const QString &url) { bool UnpackUpdate(const QString &filepath) { QFile input(filepath); - QByteArray packed; if (!input.open(QIODevice::ReadOnly)) { LOG(("Update Error: cant read updates file!")); return false; 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 40716555e6..59ed60ed3a 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -1183,8 +1183,6 @@ void ComposeControls::initAutocomplete() { } }; const auto insertMention = [=](not_null user) { - auto replacement = QString(); - auto entityTag = QString(); if (user->username.isEmpty()) { _field->insertTag( user->firstName.isEmpty() ? user->name : user->firstName, diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index 37d2e3c7d0..371a66d88e 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -2004,7 +2004,7 @@ void ListWidget::performDrag() { } TextWithEntities sel; - QList urls; + //QList urls; if (uponSelected) { // sel = getSelectedText(); } else if (pressedHandler) { diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp index aa54c9b1eb..f0dc5f1299 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp @@ -213,7 +213,7 @@ void Widget::startShowAnimation() { showChildren(); auto image = grabForPanelAnimation(); _a_opacity = base::take(opacityAnimation); - _cache = base::take(_cache); + _cache = base::take(cache); _showAnimation = std::make_unique(st::emojiPanAnimation, Ui::PanelAnimation::Origin::BottomLeft); auto inner = rect().marginsRemoved(st::emojiPanMargins); diff --git a/Telegram/SourceFiles/media/player/media_player_float.cpp b/Telegram/SourceFiles/media/player/media_player_float.cpp index bb76152055..79de6f2420 100644 --- a/Telegram/SourceFiles/media/player/media_player_float.cpp +++ b/Telegram/SourceFiles/media/player/media_player_float.cpp @@ -194,7 +194,7 @@ void Float::paintEvent(QPaintEvent *e) { const auto progress = playback ? playback->value() : 1.; if (progress > 0.) { auto pen = st::historyVideoMessageProgressFg->p; - auto was = p.pen(); + //auto was = p.pen(); pen.setWidth(st::radialLine); pen.setCapStyle(Qt::RoundCap); p.setPen(pen); diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index 16c65351f2..093e4154f6 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -476,7 +476,6 @@ void Widget::handleSongUpdate(const TrackState &state) { } void Widget::updateTimeText(const TrackState &state) { - QString time; qint64 position = 0, length = 0, display = 0; const auto frequency = state.frequency; const auto document = state.id.audio(); diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index 9258d8cdb8..2698a49e99 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -1669,7 +1669,6 @@ SessionPrivate::HandleResult SessionPrivate::handleOneReceived( auto rFrom = originalRequest->constData() + 8; const auto rEnd = originalRequest->constData() + originalRequest->size(); - auto toAck = QVector(); if (mtpTypeId(*rFrom) == mtpc_msgs_state_req) { MTPMsgsStateReq request; if (!request.read(rFrom, rEnd)) { diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index db8082cf30..e06e3fc6e2 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -31,7 +31,7 @@ CountryInput::CountryInput(QWidget *parent, const style::InputField &st) : TWidg 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); + //auto metrics = QFontMetrics(placeholderFont); auto placeholder = QString();// metrics.elidedText(tr::lng_country_fake_ph(tr::now), Qt::ElideRight, availableWidth); if (!placeholder.isNull()) { _placeholderPath.addText(0, QFontMetrics(placeholderFont).ascent(), placeholderFont, placeholder); diff --git a/Telegram/SourceFiles/ui/filter_icon_panel.cpp b/Telegram/SourceFiles/ui/filter_icon_panel.cpp index e9d3d8f47b..2ae8eee4f3 100644 --- a/Telegram/SourceFiles/ui/filter_icon_panel.cpp +++ b/Telegram/SourceFiles/ui/filter_icon_panel.cpp @@ -389,7 +389,7 @@ QImage FilterIconPanel::grabForAnimation() { _a_show = base::take(showAnimation); _showAnimation = base::take(showAnimationData); _a_opacity = base::take(opacityAnimation); - _cache = base::take(_cache); + _cache = base::take(cache); return result; } diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 34af509267..f4fbe21af5 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -658,8 +658,8 @@ void MainWindow::savePosition(Qt::WindowState state) { auto centerY = realPosition.y + realPosition.h / 2; int minDelta = 0; QScreen *chosen = nullptr; - auto screens = QGuiApplication::screens(); - for (auto screen : QGuiApplication::screens()) { + const auto screens = QGuiApplication::screens(); + for (auto screen : screens) { auto delta = (screen->geometry().center() - QPoint(centerX, centerY)).manhattanLength(); if (!chosen || delta < minDelta) { minDelta = delta;