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/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 39cc25a40..d641acd34 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -828,8 +828,6 @@ void OverviewInner::paintEvent(QPaintEvent *e) { selto = _dragSelFromIndex; } - SelectedItems::const_iterator selEnd = _selected.cend(); - if (_type == OverviewPhotos || _type == OverviewVideos) { qint32 count = _items.size(), rowsCount = count / _photosInRow + ((count % _photosInRow) ? 1 : 0); qint32 rowFrom = @@ -1682,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); @@ -1914,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 d233c7703..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; 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/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/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/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 222d8d725..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) { @@ -1728,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 { @@ -3687,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/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;