From 22b0cffccd9aff1765f68925f1137be53c5bb72e Mon Sep 17 00:00:00 2001 From: Evgeniy Zheltonozhskiy Date: Tue, 12 Jun 2018 01:59:24 +0300 Subject: [PATCH] Fix almost all warnings (#157) There are possible deprecation warnings could be on new ffmpeg. It will be investigated later. Related to #42. --- CMakeLists.txt | 2 ++ Telegram/SourceFiles/apiwrap.cpp | 1 - Telegram/SourceFiles/boxes/calendar_box.cpp | 2 -- Telegram/SourceFiles/boxes/edit_color_box.cpp | 1 - Telegram/SourceFiles/boxes/edit_privacy_box.cpp | 4 ++-- Telegram/SourceFiles/boxes/peer_list_box.cpp | 1 - .../SourceFiles/boxes/peer_list_controllers.cpp | 2 +- Telegram/SourceFiles/boxes/send_files_box.cpp | 1 - Telegram/SourceFiles/boxes/sticker_set_box.cpp | 1 - Telegram/SourceFiles/boxes/stickers_box.cpp | 6 +++--- .../chat_helpers/field_autocomplete.cpp | 2 -- .../SourceFiles/chat_helpers/gifs_list_widget.cpp | 1 - .../chat_helpers/stickers_list_widget.cpp | 7 +++---- .../SourceFiles/chat_helpers/tabbed_panel.cpp | 1 - .../SourceFiles/chat_helpers/tabbed_selector.cpp | 2 -- Telegram/SourceFiles/codegen/style/generator.cpp | 4 ++-- .../SourceFiles/dialogs/dialogs_inner_widget.cpp | 7 +++---- Telegram/SourceFiles/dialogs/dialogs_layout.cpp | 2 +- .../dialogs/dialogs_search_from_controllers.cpp | 3 --- .../history/history_admin_log_section.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 6 +----- Telegram/SourceFiles/media/media_clip_reader.cpp | 1 - .../media/player/media_player_cover.cpp | 7 ++----- .../media/player/media_player_widget.cpp | 5 ++--- Telegram/SourceFiles/mediaview.cpp | 4 ++-- Telegram/SourceFiles/mtproto/session.cpp | 1 - Telegram/SourceFiles/overviewwidget.cpp | 15 +-------------- .../platform/linux/main_window_linux.cpp | 10 +--------- .../SourceFiles/profile/profile_block_widget.h | 1 - Telegram/SourceFiles/settings/settings_cover.cpp | 1 - Telegram/SourceFiles/storage/localimageloader.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 4 ++-- Telegram/SourceFiles/ui/countryinput.cpp | 2 -- Telegram/SourceFiles/ui/emoji_config.cpp | 2 -- Telegram/SourceFiles/ui/images.cpp | 2 +- Telegram/SourceFiles/ui/style/style_core.cpp | 1 - Telegram/SourceFiles/ui/text/text.cpp | 1 - Telegram/SourceFiles/ui/text/text_block.cpp | 2 +- Telegram/SourceFiles/ui/text/text_entity.cpp | 7 +++---- Telegram/SourceFiles/ui/text/text_entity.h | 2 +- .../SourceFiles/ui/widgets/inner_dropdown.cpp | 7 ------- Telegram/SourceFiles/ui/widgets/input_fields.cpp | 12 ++++-------- Telegram/SourceFiles/ui/widgets/multi_select.cpp | 1 - Telegram/SourceFiles/ui/widgets/tooltip.cpp | 1 - .../window/notifications_utilities.cpp | 3 +-- .../SourceFiles/window/themes/window_theme.cpp | 1 - .../window/themes/window_theme_preview.cpp | 5 +---- 47 files changed, 42 insertions(+), 116 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0dbb3f47..208dcec8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,8 @@ if (CCACHE) set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) endif() + +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") add_subdirectory(Telegram) # clang-format diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 4211f910c..a6a9c8ac3 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -41,7 +41,6 @@ namespace { constexpr auto kReloadChannelMembersTimeout = 1000; // 1 second wait before reload members in channel after adding constexpr auto kSaveCloudDraftTimeout = 1000; // save draft to the cloud with 1 sec extra delay -constexpr auto kSaveDraftBeforeQuitTimeout = 1500; // give the app 1.5 secs to save drafts to cloud when quitting constexpr auto kSmallDelayMs = 5; constexpr auto kStickersUpdateTimeout = 3600000; // update not more than once in an hour constexpr auto kUnreadMentionsPreloadIfLess = 5; diff --git a/Telegram/SourceFiles/boxes/calendar_box.cpp b/Telegram/SourceFiles/boxes/calendar_box.cpp index a01af4934..e0349db9f 100644 --- a/Telegram/SourceFiles/boxes/calendar_box.cpp +++ b/Telegram/SourceFiles/boxes/calendar_box.cpp @@ -125,8 +125,6 @@ void CalendarBox::Context::applyMonth(const QDate &month, bool forced) { _daysCount = month.daysInMonth(); _daysShift = daysShiftForMonth(month); _rowsCount = rowsCountForMonth(month); - auto yearIndex = month.year(); - auto monthIndex = month.month(); _highlightedIndex = month.daysTo(_highlighted); _minDayIndex = _min.isNull() ? INT_MIN : month.daysTo(_min); _maxDayIndex = _max.isNull() ? INT_MAX : month.daysTo(_max); diff --git a/Telegram/SourceFiles/boxes/edit_color_box.cpp b/Telegram/SourceFiles/boxes/edit_color_box.cpp index 9cfacf9fb..4451fde63 100644 --- a/Telegram/SourceFiles/boxes/edit_color_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_color_box.cpp @@ -742,7 +742,6 @@ void EditColorBox::updateHSVFields() { auto hue = std::round((1. - _hueSlider->value()) * 360); auto saturation = std::round(_picker->valueX() * 255); auto brightness = std::round((1. - _picker->valueY()) * 255); - auto alpha = std::round(_opacitySlider->value() * 255); _hueField->setTextWithFocus(QString::number(hue)); _saturationField->setTextWithFocus(QString::number(percentFromByte(saturation))); _brightnessField->setTextWithFocus(QString::number(percentFromByte(brightness))); diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index c06446e48..292768a89 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -110,7 +110,7 @@ void EditPrivacyBox::prepare() { int EditPrivacyBox::resizeGetHeight(int newWidth) { auto top = 0; - auto layoutRow = [this, newWidth, &top](auto &widget, style::margins padding) { + auto layoutRow = [newWidth, &top](auto &widget, style::margins padding) { if (!widget) return; widget->resizeToNaturalWidth(newWidth - padding.left() - padding.right()); widget->moveToLeft(padding.left(), top + padding.top()); @@ -152,7 +152,7 @@ int EditPrivacyBox::countDefaultHeight(int newWidth) { } return st::editPrivacyOptionMargin.top() + st::defaultCheck.diameter + st::editPrivacyOptionMargin.bottom(); }; - auto labelHeight = [this, newWidth](const QString &text, const style::FlatLabel &st, style::margins padding) { + auto labelHeight = [newWidth](const QString &text, const style::FlatLabel &st, style::margins padding) { if (text.isEmpty()) { return 0; } diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index 4b371b75e..df45501bd 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -973,7 +973,6 @@ void PeerListBox::Inner::paintRow(Painter &p, TimeMs ms, RowIndex index) { p.drawTextLeft(namex, st::contactsPadding.top() + st::contactsStatusTop, width(), highlightedPart); } else { grayedPart = st::contactsStatusFont->elided(grayedPart, availableWidth - highlightedWidth); - auto grayedWidth = st::contactsStatusFont->width(grayedPart); p.setPen(st::contactsStatusFgOnline); p.drawTextLeft(namex, st::contactsPadding.top() + st::contactsStatusTop, width(), highlightedPart); p.setPen(selected ? st::contactsStatusFgOver : st::contactsStatusFg); diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp index 426b14e64..c1607f4a8 100644 --- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp @@ -667,7 +667,7 @@ void EditChatAdminsBoxController::Start(not_null chat) { } void AddBotToGroupBoxController::Start(not_null bot) { - auto initBox = [bot](not_null box) { + auto initBox = [](not_null box) { box->addButton(langFactory(lng_cancel), [box] { box->closeBox(); }); }; Ui::show(Box(std::make_unique(bot), std::move(initBox))); diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 923701fb5..bc3867384 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -716,7 +716,6 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) { } } else if (_doc) { qint32 w = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); - qint32 h = _thumbw ? (0 + st::msgFileThumbSize + 0) : (0 + st::msgFileSize + 0); qint32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0; if (_thumbw) { nameleft = 0 + st::msgFileThumbSize + st::msgFileThumbPadding.right(); diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index d7c4c035c..3d9177718 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -369,7 +369,6 @@ void StickerSetBox::Inner::paintEvent(QPaintEvent *e) { if (_pack.isEmpty()) return; auto ms = getms(); - qint32 rows = _pack.size() / kStickersPanelPerRow + ((_pack.size() % kStickersPanelPerRow) ? 1 : 0); qint32 from = std::floor(e->rect().top() / st::stickersSize.height()), to = std::floor(e->rect().bottom() / st::stickersSize.height()) + 1; diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index f3f04498f..5b0dd3312 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -952,12 +952,12 @@ void StickersBox::Inner::setPressed(int pressed) { update(0, _itemsTop + _pressed * _rowHeight, width(), _rowHeight); auto &set = _rows[_pressed]; auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight)); - if (!_rows[_pressed]->ripple) { - _rows[_pressed]->ripple = std::make_unique( + if (!set->ripple) { + set->ripple = std::make_unique( st::contactsRipple, std::move(rippleMask), [this, index = _pressed] { update(0, _itemsTop + index * _rowHeight, width(), _rowHeight); }); } - _rows[_pressed]->ripple->add(mapFromGlobal(QCursor::pos()) - QPoint(0, _itemsTop + _pressed * _rowHeight)); + set->ripple->add(mapFromGlobal(QCursor::pos()) - QPoint(0, _itemsTop + _pressed * _rowHeight)); } } diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index ecf9eeaff..9e4e0cb5c 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -548,7 +548,6 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) { QRect r(e->rect()); if (r != rect()) p.setClipRect(r); - qint32 atwidth = st::mentionFont->width('@'), hashwidth = st::mentionFont->width('#'); qint32 mentionleft = 2 * st::mentionPadding.left() + st::mentionPhotoSize; qint32 mentionwidth = width() - mentionleft - 2 * st::mentionPadding.right(); qint32 htagleft = st::historyAttach.width + st::historyComposeField.textMrg.left() - st::lineWidth, @@ -928,7 +927,6 @@ void FieldAutocompleteInner::onUpdateSelected(bool force) { qint32 sel = -1, maxSel = 0; if (!_srows->isEmpty()) { - qint32 rows = rowscount(_srows->size(), _stickersPerRow); qint32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1; diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index 5bf5edb81..eae203371 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -730,7 +730,6 @@ bool GifsListWidget::inlineItemVisible(const InlineBots::Layout::ItemBase *layou auto col = position % MatrixRowShift; Assert((row < _rows.size()) && (col < _rows[row].items.size())); - auto &inlineItems = _rows[row].items; auto top = 0; for (auto i = 0; i != row; ++i) { top += _rows[i].height; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 626582d64..abcebf19d 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -128,7 +128,6 @@ StickersListWidget::Footer::Footer(not_null parent) template void StickersListWidget::Footer::enumerateVisibleIcons(Callback callback) { int iconsX = std::round(_iconsX.current()); - auto index = iconsX / st::emojiCategory.width; auto x = _iconsLeft - (iconsX % st::emojiCategory.width); for (auto index = std::min(_icons.size(), iconsX / st::emojiCategory.width), last = std::min(_icons.size(), index + kVisibleIconsCount); @@ -139,7 +138,7 @@ template void StickersListWidget::Footer::enumerateVisibleIc } void StickersListWidget::Footer::preloadImages() { - enumerateVisibleIcons([this](const StickerIcon &icon, int x) { + enumerateVisibleIcons([](const StickerIcon &icon, int x) { if (auto sticker = icon.sticker) { sticker->thumb->load(); } @@ -1547,7 +1546,7 @@ void StickersListWidget::setSelected(OverState newSelected) { setCursor(newSelected ? style::cur_pointer : style::cur_default); auto &sets = shownSets(); - auto updateSelected = [this, &sets]() { + auto updateSelected = [this]() { if (auto sticker = base::get_if(&_selected)) { rtlupdate(stickerRect(sticker->section, sticker->index)); } else if (auto button = base::get_if(&_selected)) { @@ -1692,7 +1691,7 @@ void StickersListWidget::installSet(quint64 setId) { auto it = sets.constFind(setId); if (it != sets.cend()) { request(MTPmessages_InstallStickerSet(Stickers::inputSetId(*it), MTP_bool(false))) - .done([this](const MTPmessages_StickerSetInstallResult &result) { + .done([](const MTPmessages_StickerSetInstallResult &result) { if (result.type() == mtpc_messages_stickerSetInstallResultArchive) { Stickers::ApplyArchivedResult(result.c_messages_stickerSetInstallResultArchive()); } diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp index ba531b0d6..f0409087f 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp @@ -110,7 +110,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 49c609094..7d0dab0f6 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp @@ -142,8 +142,6 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, double dt, double o _frameAlpha = anim::interpolate(1, 256, opacity); - auto frameInts = _frameInts + _innerLeft + _innerTop * _frameIntsPerLine; - auto leftToRight = (_direction == Direction::LeftToRight); auto easeOut = anim::easeOutCirc(1., dt); diff --git a/Telegram/SourceFiles/codegen/style/generator.cpp b/Telegram/SourceFiles/codegen/style/generator.cpp index 2cd12a962..0753a9b45 100644 --- a/Telegram/SourceFiles/codegen/style/generator.cpp +++ b/Telegram/SourceFiles/codegen/style/generator.cpp @@ -687,7 +687,7 @@ bool Generator::writeIncludesInSource() { } auto includes = QStringList(); - std::function collector = [this, &collector, &includes](const Module &module) { + std::function collector = [&collector, &includes](const Module &module) { module.enumIncludes(collector); auto base = moduleBaseName(module); if (!includes.contains(base)) { @@ -771,7 +771,7 @@ void palette::finalize() {\n\ compute(0, -1, { 255, 255, 255, 0}); // special color\n"; QList names; - module_.enumVariables([this, &names](const Variable &variable) -> bool { + module_.enumVariables([&names](const Variable &variable) -> bool { names.push_back(variable.name); return true; }); diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 945630879..8237d4dde 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -104,7 +104,7 @@ DialogsInner::DialogsInner(QWidget *parent, not_null contr UpdateRowSection::Default | UpdateRowSection::Filtered); }); - subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) { + subscribe(Window::Theme::Background(), [](const Window::Theme::BackgroundUpdate &data) { if (data.paletteChanged()) { Dialogs::Layout::clearUnreadBadgesCache(); } @@ -2021,7 +2021,7 @@ void DialogsInner::loadPeerPhotos() { qint32 from = (yFrom - filteredOffset()) / st::dialogsRowHeight; if (from < 0) from = 0; if (from < _filterResults.size()) { - qint32 to = (yTo / qint32(st::dialogsRowHeight)) + 1, w = width(); + qint32 to = (yTo / qint32(st::dialogsRowHeight)) + 1; if (to > _filterResults.size()) to = _filterResults.size(); for (; from < to; ++from) { @@ -2038,8 +2038,7 @@ void DialogsInner::loadPeerPhotos() { qint32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / qint32(st::dialogsRowHeight)) : 0) - - _filterResults.size() + 1, - w = width(); + _filterResults.size() + 1; if (to > _peerSearchResults.size()) to = _peerSearchResults.size(); for (; from < to; ++from) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index f30fcdb34..8fc79bd20 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -363,7 +363,7 @@ void RowPainter::paint(Painter &p, const Row *row, int fullWidth, bool active, b history->lastItemTextCache); } }, - [&p, fullWidth, active, selected, ms, history, unreadCount] { + [&p, active, history, unreadCount] { if (unreadCount) { auto counter = QString::number(unreadCount); if (counter.size() > 4) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp index fd9a0647f..97a403eeb 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp @@ -79,9 +79,6 @@ void ChatSearchFromController::rowClicked(not_null row) { } void ChatSearchFromController::rebuildRows() { - auto ms = getms(); - auto wasEmpty = !delegate()->peerListFullRowsCount(); - auto now = unixtime(); QMultiMap ordered; if (_chat->noParticipantInfo()) { diff --git a/Telegram/SourceFiles/history/history_admin_log_section.cpp b/Telegram/SourceFiles/history/history_admin_log_section.cpp index cc3cef54a..b8fe16534 100644 --- a/Telegram/SourceFiles/history/history_admin_log_section.cpp +++ b/Telegram/SourceFiles/history/history_admin_log_section.cpp @@ -379,7 +379,7 @@ void Widget::paintEvent(QPaintEvent *e) { Painter p(this); auto clip = e->rect(); - auto ms = getms(); + // auto ms = getms(); //_historyDownShown.step(ms); auto fill = QRect(0, 0, width(), App::main()->height()); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index bcf83df4d..2cc9620a9 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -920,7 +920,6 @@ void MainWidget::showSendPathsLayer() { void MainWidget::deleteLayer(int selectedCount) { if (selectedCount) { - auto forDelete = true; auto selected = _overview ? _overview->getSelectedItems() : _history->getSelectedItems(); if (!selected.isEmpty()) { Ui::show(Box(selected)); @@ -1307,7 +1306,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu if (h) Local::addSavedPeer(peer, h->lastMsgDate); } else if (peer->isChannel()) { if (peer->asChannel()->inviter > 0 && peer->asChannel()->amIn()) { - if (auto from = App::userLoaded(peer->asChannel()->inviter)) { + if (App::userLoaded(peer->asChannel()->inviter)) { auto h = App::history(peer->id); h->clear(true); h->addNewerSlice(QVector()); @@ -1358,9 +1357,6 @@ void MainWidget::onCacheBackground() { 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(); diff --git a/Telegram/SourceFiles/media/media_clip_reader.cpp b/Telegram/SourceFiles/media/media_clip_reader.cpp index 3d1a16d6d..7bc814787 100644 --- a/Telegram/SourceFiles/media/media_clip_reader.cpp +++ b/Telegram/SourceFiles/media/media_clip_reader.cpp @@ -769,7 +769,6 @@ Manager::ResultHandleState Manager::handleResult(ReaderPrivate *reader, ProcessR auto it = constUnsafeFindReaderPointer(reader); if (it != _readerPointers.cend()) { qint32 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_cover.cpp b/Telegram/SourceFiles/media/player/media_player_cover.cpp index 03ffd608c..095600e7b 100644 --- a/Telegram/SourceFiles/media/player/media_player_cover.cpp +++ b/Telegram/SourceFiles/media/player/media_player_cover.cpp @@ -279,13 +279,10 @@ void CoverWidget::handleSongUpdate(const TrackState &state) { void CoverWidget::updateTimeText(const TrackState &state) { QString time; - qint64 position = 0, length = 0, display = 0; + qint64 display = 0; auto frequency = state.frequency; if (!IsStoppedOrStopping(state.state)) { - display = position = state.position; - length = state.length; - } else { - length = state.length ? state.length : (state.id.audio()->song()->duration * frequency); + display = state.position; } _lastDurationMs = (state.length * 1000LL) / frequency; diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index a65ee433e..7abcdc69d 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -431,11 +431,10 @@ void Widget::handleSongUpdate(const TrackState &state) { void Widget::updateTimeText(const TrackState &state) { QString time; - qint64 position = 0, length = 0, display = 0; + qint64 display = 0; auto frequency = state.frequency; if (!IsStoppedOrStopping(state.state)) { - display = position = state.position; - length = state.length; + display = state.position; } else if (state.length) { display = state.length; } else if (state.id.audio()->song()) { diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 7fd7447c7..d3bbb7c6a 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -2141,7 +2141,7 @@ void MediaView::paintThemePreview(Painter &p, QRect clip) { if (titleRect.x() < 0) { titleRect = QRect(0, _themePreviewRect.y(), width(), st::themePreviewMargin.top()); } - if (auto fillTitleRect = (titleRect.y() < 0)) { + if (titleRect.y() < 0) { titleRect.moveTop(0); fillOverlay(titleRect); } @@ -2157,7 +2157,7 @@ void MediaView::paintThemePreview(Painter &p, QRect clip) { auto buttonsRect = QRect(_themePreviewRect.x(), _themePreviewRect.y() + _themePreviewRect.height() - st::themePreviewMargin.bottom(), _themePreviewRect.width(), st::themePreviewMargin.bottom()); - if (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/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp index 61cd75b80..d27496711 100644 --- a/Telegram/SourceFiles/mtproto/session.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -52,7 +52,6 @@ void SessionData::clear(Instance *instance) { { QReadLocker locker1(haveSentMutex()), locker2(toResendMutex()), locker3(haveReceivedMutex()), locker4(wereAckedMutex()); - auto receivedResponsesEnd = _receivedResponses.cend(); clearCallbacks.reserve(_haveSent.size() + _wereAcked.size()); for (auto i = _haveSent.cbegin(), e = _haveSent.cend(); i != e; ++i) { auto requestId = i.value()->requestId; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 56d8ba25a..d641acd34 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -784,11 +784,6 @@ bool OverviewInner::preloadLocal() { } TextSelection OverviewInner::itemSelectedValue(qint32 index) const { - qint32 selfrom = -1, selto = -1; - if (_dragSelFromIndex >= 0 && _dragSelToIndex >= 0) { - selfrom = _dragSelToIndex; - selto = _dragSelFromIndex; - } if (_items.at(index)->toMediaItem()) { // draw item if (index >= _dragSelToIndex && index <= _dragSelFromIndex && _dragSelToIndex >= 0) { return (_dragSelecting && _items.at(index)->msgId() > 0) ? FullSelection : TextSelection{0, 0}; @@ -833,9 +828,6 @@ void OverviewInner::paintEvent(QPaintEvent *e) { selto = _dragSelFromIndex; } - SelectedItems::const_iterator selEnd = _selected.cend(); - bool hasSel = !_selected.isEmpty(); - if (_type == OverviewPhotos || _type == OverviewVideos) { qint32 count = _items.size(), rowsCount = count / _photosInRow + ((count % _photosInRow) ? 1 : 0); qint32 rowFrom = @@ -859,7 +851,7 @@ void OverviewInner::paintEvent(QPaintEvent *e) { } } else { p.translate(_rowsLeft, _marginTop); - qint32 y = 0, w = _rowWidth; + qint32 y = 0; for (qint32 j = 0, l = _items.size(); j < l; ++j) { qint32 i = _reversed ? (l - j - 1) : j, nexti = _reversed ? (i - 1) : (i + 1); qint32 nextItemTop = @@ -897,7 +889,6 @@ void OverviewInner::onUpdateSelected() { ClickHandlerHost *lnkhost = nullptr; HistoryItem *item = 0; qint32 index = -1; - qint32 newsel = 0; HistoryCursorState cursorState = HistoryDefaultCursorState; if (_type == OverviewPhotos || _type == OverviewVideos) { double w = (double(_width - st::overviewPhotoSkip) / _photosInRow); @@ -1018,8 +1009,6 @@ void OverviewInner::onUpdateSelected() { bool canSelectMany = (_peer != 0); if (_mousedItem == _dragItem && lnk && !_selected.isEmpty() && _selected.cbegin().value() != FullSelection) { - bool afterSymbol = false, uponSymbol = false; - quint16 second = 0; _selected[_dragItem] = {0, 0}; updateDragSelection(0, -1, 0, -1, false); } else if (canSelectMany) { @@ -1691,7 +1680,6 @@ void OverviewInner::mediaOverviewUpdated() { auto &o = _history->overview(_type); auto migratedOverview = _migrated ? &_migrated->overview(_type) : nullptr; auto migrateCount = migratedIndexSkip(); - auto wasCount = _items.size(); auto fullCount = (migrateCount + o.size()); auto tocheck = std::min(fullCount, _itemsToBeLoaded); _items.reserve(tocheck); @@ -1923,7 +1911,6 @@ int OverviewInner::countHeight() { if (_type == OverviewPhotos || _type == OverviewVideos) { auto count = _items.size(); auto migratedFullCount = _migrated ? _migrated->overviewCount(_type) : 0; - auto fullCount = migratedFullCount + _history->overviewCount(_type); auto rows = (count / _photosInRow) + ((count % _photosInRow) ? 1 : 0); return (_rowWidth + st::overviewPhotoSkip) * rows + st::overviewPhotoSkip; } diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index dec6afdb5..5b84f889a 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -36,7 +36,6 @@ namespace Platform { namespace { bool noQtTrayIcon = false, tryAppIndicator = false; -bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false; qint32 _trayIconSize = 22; @@ -209,9 +208,6 @@ void MainWindow::unreadCounterChangedHook() { void MainWindow::updateIconCounters() { updateWindowIcon(); - auto counter = App::histories().unreadBadge(); - - if (noQtTrayIcon) { } else if (trayIcon) { QIcon icon; @@ -251,13 +247,10 @@ void MainWindow::psCreateTrayIcon() { void MainWindow::psFirstShow() { psCreateTrayIcon(); - psUpdateMargins(); - bool showShadows = true; - show(); - //_private.enableShadow(winId()); + if (cWindowPos().maximized) { DEBUG_LOG(("Window Pos: First show, setting maximized.")); setWindowState(Qt::WindowMaximized); @@ -270,7 +263,6 @@ void MainWindow::psFirstShow() { } else { show(); } - showShadows = false; } else { show(); } diff --git a/Telegram/SourceFiles/profile/profile_block_widget.h b/Telegram/SourceFiles/profile/profile_block_widget.h index a4897b45b..7ba38761d 100644 --- a/Telegram/SourceFiles/profile/profile_block_widget.h +++ b/Telegram/SourceFiles/profile/profile_block_widget.h @@ -55,7 +55,6 @@ protected: int resizeGetHeight(int newWidth) override = 0; void contentSizeUpdated() { - auto oldHeight = height(); resizeToWidth(width()); emit heightUpdated(); } diff --git a/Telegram/SourceFiles/settings/settings_cover.cpp b/Telegram/SourceFiles/settings/settings_cover.cpp index 1945bb8b2..4db2d57c9 100644 --- a/Telegram/SourceFiles/settings/settings_cover.cpp +++ b/Telegram/SourceFiles/settings/settings_cover.cpp @@ -134,7 +134,6 @@ int CoverWidget::resizeGetHeight(int newWidth) { void CoverWidget::refreshButtonsGeometry(int newWidth) { int buttonLeft = _userpicButton->x() + _userpicButton->width() + st::settingsButtonLeft; - int buttonsRight = newWidth - st::settingsButtonSkip; _setPhoto->moveToLeft(buttonLeft, _userpicButton->y() + st::settingsButtonTop, newWidth); buttonLeft += _setPhoto->width() + st::settingsButtonSkip; _editName->moveToLeft(buttonLeft, _setPhoto->y(), newWidth); diff --git a/Telegram/SourceFiles/storage/localimageloader.cpp b/Telegram/SourceFiles/storage/localimageloader.cpp index 9e9110c86..2d98ca02a 100644 --- a/Telegram/SourceFiles/storage/localimageloader.cpp +++ b/Telegram/SourceFiles/storage/localimageloader.cpp @@ -359,7 +359,7 @@ void FileLoadTask::process() { filemime = _information->filemime; if (auto image = base::get_if(&_information->media)) { fullimage = base::take(image->data); - if (auto opaque = (filemime != stickerMime)) { + if (filemime != stickerMime) { fullimage = Images::prepareOpaque(std::move(fullimage)); } isAnimation = image->animated; diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 97cd50321..ff876ecc6 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -138,7 +138,7 @@ void EmptyUserpic::Impl::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; @@ -1774,7 +1774,7 @@ void DocumentData::performActionOnLoad() { auto playAnimation = isAnimation() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && showImage && item && item->getMedia(); - if (auto applyTheme = isTheme()) { + if (isTheme()) { if (!loc.isEmpty() && loc.accessEnable()) { Messenger::Instance().showDocument(this, item); loc.accessDisable(); diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index 22fe505c3..91f5ab914 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -97,8 +97,6 @@ CountryInput::CountryInput(QWidget *parent, const style::InputField &st) initCountries(); 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/emoji_config.cpp b/Telegram/SourceFiles/ui/emoji_config.cpp index 7ef4d3332..00ba30a77 100644 --- a/Telegram/SourceFiles/ui/emoji_config.cpp +++ b/Telegram/SourceFiles/ui/emoji_config.cpp @@ -30,8 +30,6 @@ namespace Ui { namespace Emoji { namespace { -constexpr auto kSaveRecentEmojiTimeout = 3000; - auto WorkingIndex = -1; void AppendPartToResult(TextWithEntities &result, const QChar *start, const QChar *from, const QChar *to) { diff --git a/Telegram/SourceFiles/ui/images.cpp b/Telegram/SourceFiles/ui/images.cpp index b9ba458be..eff8fd857 100644 --- a/Telegram/SourceFiles/ui/images.cpp +++ b/Telegram/SourceFiles/ui/images.cpp @@ -73,7 +73,7 @@ QImage prepareBlur(QImage img) { uchar *pix = img.bits(); if (pix) { - int w = img.width(), h = img.height(), wold = w, hold = h; + int w = img.width(), h = img.height(); const int radius = 3; const int r1 = radius + 1; const int div = radius * 2 + 1; diff --git a/Telegram/SourceFiles/ui/style/style_core.cpp b/Telegram/SourceFiles/ui/style/style_core.cpp index 85b340f0b..9a696d161 100644 --- a/Telegram/SourceFiles/ui/style/style_core.cpp +++ b/Telegram/SourceFiles/ui/style/style_core.cpp @@ -84,7 +84,6 @@ void colorizeImage(const QImage &src, QColor c, QImage *outResult, QRect srcRect auto pattern = anim::shifted(c); - auto resultBytesPerPixel = (src.depth() >> 3); constexpr auto resultIntsPerPixel = 1; auto resultIntsPerLine = (outResult->bytesPerLine() >> 2); auto resultIntsAdded = resultIntsPerLine - width * resultIntsPerPixel; diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp index 731379bbf..7f458cf58 100644 --- a/Telegram/SourceFiles/ui/text/text.cpp +++ b/Telegram/SourceFiles/ui/text/text.cpp @@ -513,7 +513,6 @@ public: qint32 i = 0, l = preparsed.size(); source.entities.clear(); source.entities.reserve(l); - const QChar s = source.text.size(); for (; i < l; ++i) { auto type = preparsed.at(i).type(); if (((type == EntityInTextMention || type == EntityInTextMentionName) && !parseMentions) || diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp index 283879d53..635163714 100644 --- a/Telegram/SourceFiles/ui/text/text_block.cpp +++ b/Telegram/SourceFiles/ui/text/text_block.cpp @@ -341,7 +341,7 @@ EmojiBlock::EmojiBlock(const style::font &font, const QString &str, quint16 from : ITextBlock(font, str, from, length, flags, lnkIndex) , emoji(emoji) { _flags |= ((TextBlockTEmoji & 0x0F) << 8); - _width = int(st::emojiSize + 2 * st::emojiPadding); + _width = st::emojiSize + 2 * st::emojiPadding; _rpadding = 0; for (auto i = length; i != 0;) { diff --git a/Telegram/SourceFiles/ui/text/text_entity.cpp b/Telegram/SourceFiles/ui/text/text_entity.cpp index 7667613ca..fe42b9898 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.cpp +++ b/Telegram/SourceFiles/ui/text/text_entity.cpp @@ -1253,7 +1253,7 @@ QString EscapeForRichParsing(const QString &text) { QString SingleLine(const QString &text) { auto result = text; - auto s = text.unicode(), ch = s, e = text.unicode() + text.size(); + auto s = text.unicode(), e = text.unicode() + text.size(); // Trim. while (s < e && chIsTrimmed(*s)) { @@ -1315,7 +1315,6 @@ QStringList PrepareSearchWords(const QString &query, const QRegularExpression *S auto result = QStringList(); if (!clean.isEmpty()) { auto list = clean.split(SplitterOverride ? *SplitterOverride : RegExpWordSplit(), QString::SkipEmptyParts); - auto size = list.size(); result.reserve(list.size()); for_const (auto &word, list) { auto trimmed = word.trimmed(); @@ -1401,7 +1400,7 @@ bool CutPart(TextWithEntities &sending, TextWithEntities &left, qint32 limit) { } int elen = 0; - if (auto e = Ui::Emoji::Find(ch, end, &elen)) { + if (Ui::Emoji::Find(ch, end, &elen)) { for (int i = 0; i < elen; ++i, ++ch, ++s) { if (ch->isHighSurrogate() && i + 1 < elen && (ch + 1)->isLowSurrogate()) { ++ch; @@ -2066,7 +2065,7 @@ QString ApplyEntities(const TextWithEntities &text) { QString result; qint32 size = text.text.size(); - const QChar *b = text.text.constData(), *already = b, *e = b + size; + const QChar *b = text.text.constData(), *already = b; //, *e = b + size; auto entity = text.entities.cbegin(), end = text.entities.cend(); auto skipTillRelevantAndGetTag = [&entity, &end, size, &tags] { while (entity != end) { diff --git a/Telegram/SourceFiles/ui/text/text_entity.h b/Telegram/SourceFiles/ui/text/text_entity.h index e9340a1fc..8e6ffb2d0 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.h +++ b/Telegram/SourceFiles/ui/text/text_entity.h @@ -219,7 +219,7 @@ enum class PrepareTextOption { CheckLinks, }; inline QString PrepareForSending(const QString &text, PrepareTextOption option = PrepareTextOption::IgnoreLinks) { - auto result = TextWithEntities{text}; + auto result = TextWithEntities{text}; // , {}} auto prepareFlags = (option == PrepareTextOption::CheckLinks) ? (TextParseLinks | TextParseMentions | TextParseHashtags | TextParseBotCommands) : 0; diff --git a/Telegram/SourceFiles/ui/widgets/inner_dropdown.cpp b/Telegram/SourceFiles/ui/widgets/inner_dropdown.cpp index 6faa3bb58..7577230ee 100644 --- a/Telegram/SourceFiles/ui/widgets/inner_dropdown.cpp +++ b/Telegram/SourceFiles/ui/widgets/inner_dropdown.cpp @@ -28,13 +28,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include -namespace { - -constexpr double kFadeHeight = 1. / 3; -constexpr int kFadeAlphaMax = 160; - -} // namespace - namespace Ui { InnerDropdown::InnerDropdown(QWidget *parent, const style::InnerDropdown &st) diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index 48431c756..f376ef91c 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -302,7 +302,6 @@ void FlatTextarea::touchEvent(QTouchEvent *e) { case QEvent::TouchEnd: if (!_touchPress) return; if (!_touchMove && window()) { - Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton); QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart)); if (_touchRightButton) { @@ -1567,7 +1566,6 @@ void FlatInput::touchEvent(QTouchEvent *e) { case QEvent::TouchEnd: if (!_touchPress) return; if (!_touchMove && window()) { - Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton); QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart)); if (_touchRightButton) { @@ -1729,9 +1727,8 @@ void FlatInput::phPrepare(Painter &p, double placeholderFocused) { void FlatInput::keyPressEvent(QKeyEvent *e) { QString wasText(_oldtext); - bool shift = e->modifiers().testFlag(Qt::ShiftModifier), alt = e->modifiers().testFlag(Qt::AltModifier); - bool ctrl = e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier), - ctrlGood = true; + bool shift = e->modifiers().testFlag(Qt::ShiftModifier); + bool ctrl = e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier); if (_customUpDown && (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)) { e->ignore(); } else { @@ -3688,9 +3685,8 @@ void MaskedInputField::keyPressEvent(QKeyEvent *e) { QString wasText(_oldtext); qint32 wasCursor(_oldcursor); - bool shift = e->modifiers().testFlag(Qt::ShiftModifier), alt = e->modifiers().testFlag(Qt::AltModifier); - bool ctrl = e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier), - ctrlGood = true; + bool shift = e->modifiers().testFlag(Qt::ShiftModifier); + bool ctrl = e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier); if (_customUpDown && (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)) { e->ignore(); } else { diff --git a/Telegram/SourceFiles/ui/widgets/multi_select.cpp b/Telegram/SourceFiles/ui/widgets/multi_select.cpp index 21b3cf215..44a6750aa 100644 --- a/Telegram/SourceFiles/ui/widgets/multi_select.cpp +++ b/Telegram/SourceFiles/ui/widgets/multi_select.cpp @@ -139,7 +139,6 @@ bool MultiSelect::Item::paintCached(Painter &p, int x, int y, int outerWidth) { PainterHighQualityEnabler hq(p); auto opacity = _visibility.current(_hiding ? 0. : 1.); - auto scale = opacity + _st.minScale * (1. - opacity); auto height = opacity * _cache.height() / _cache.devicePixelRatio(); auto width = opacity * _cache.width() / _cache.devicePixelRatio(); diff --git a/Telegram/SourceFiles/ui/widgets/tooltip.cpp b/Telegram/SourceFiles/ui/widgets/tooltip.cpp index 260c26df6..7944d5330 100644 --- a/Telegram/SourceFiles/ui/widgets/tooltip.cpp +++ b/Telegram/SourceFiles/ui/widgets/tooltip.cpp @@ -381,7 +381,6 @@ void ImportantTooltip::updateGeometry() { } void ImportantTooltip::resizeEvent(QResizeEvent *e) { - auto inner = countInner(); auto contentTop = _st.padding.top(); if (_useTransparency && (_side & RectPart::Bottom)) { contentTop += _st.arrow; diff --git a/Telegram/SourceFiles/window/notifications_utilities.cpp b/Telegram/SourceFiles/window/notifications_utilities.cpp index 4a4ec8ff3..6d5e9b279 100644 --- a/Telegram/SourceFiles/window/notifications_utilities.cpp +++ b/Telegram/SourceFiles/window/notifications_utilities.cpp @@ -113,11 +113,10 @@ void CachedUserpics::onClear() { CachedUserpics::~CachedUserpics() { if (_someSavedFlag) { - TimeMs result = 0; for_const (auto &item, _images) { QFile(item.path).remove(); } // This works about 1200ms on Windows for a folder with one image O_o - // psDeleteDir(cWorkingDir() + qsl("tdata/temp")); + // psDeleteDir(cWorkingDir() + qsl("tdata/temp")); } } diff --git a/Telegram/SourceFiles/window/themes/window_theme.cpp b/Telegram/SourceFiles/window/themes/window_theme.cpp index 307da73b5..9158ba88b 100644 --- a/Telegram/SourceFiles/window/themes/window_theme.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme.cpp @@ -366,7 +366,6 @@ void adjustColorsUsingBackground(const QImage &img) { Assert(img.format() == QImage::Format_ARGB32_Premultiplied); quint64 components[3] = {0}; - quint64 componentsScroll[3] = {0}; auto w = img.width(); auto h = img.height(); auto size = w * h; diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index a1b108bd6..af90c2543 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -651,7 +651,6 @@ void Generator::paintRow(const Row &row) { auto availableWidth = namewidth; if (row.unreadCounter) { auto counter = QString::number(row.unreadCounter); - auto mutedCounter = row.muted; auto unreadRight = x + fullWidth - st::dialogsPadding.x(); auto unreadTop = texttop + st::dialogsTextFont->ascent - st::dialogsUnreadFont->ascent - (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2; @@ -815,10 +814,8 @@ void Generator::paintBubble(const Bubble &bubble) { bubble.text.draw(*_p, trect.x(), trect.y(), trect.width()); } else if (!bubble.waveform.isEmpty()) { auto nameleft = x + st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); - auto nametop = y + st::msgFileNameTop; auto nameright = st::msgFilePadding.left(); auto statustop = y + st::msgFileStatusTop; - auto bottom = y + st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); auto inner = rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, _rect.width()); @@ -835,7 +832,7 @@ void Generator::paintBubble(const Bubble &bubble) { // rescale waveform by going in waveform.size * bar_count 1D grid auto active = bubble.outbg ? st::msgWaveformOutActive[_palette] : st::msgWaveformInActive[_palette]; auto inactive = bubble.outbg ? st::msgWaveformOutInactive[_palette] : st::msgWaveformInInactive[_palette]; - qint32 wf_size = bubble.waveform.size(), availw = namewidth + st::msgWaveformSkip; + qint32 wf_size = bubble.waveform.size(); qint32 bar_count = wf_size; qint32 max_delta = st::msgWaveformMax - st::msgWaveformMin; auto wave_bottom = y + st::msgFilePadding.top() + st::msgWaveformMax;