Further warning fixes

This commit is contained in:
Evgenii Zheltonozhskii 2018-06-08 19:50:27 +03:00
parent f9c7e0bddb
commit 2563fa0dff
12 changed files with 7 additions and 35 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -55,7 +55,6 @@ protected:
int resizeGetHeight(int newWidth) override = 0;
void contentSizeUpdated() {
auto oldHeight = height();
resizeToWidth(width());
emit heightUpdated();
}

View File

@ -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) {

View File

@ -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;) {

View File

@ -28,13 +28,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <QWindow>
namespace {
constexpr double kFadeHeight = 1. / 3;
constexpr int kFadeAlphaMax = 160;
} // namespace
namespace Ui {
InnerDropdown::InnerDropdown(QWidget *parent, const style::InnerDropdown &st)

View File

@ -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 {

View File

@ -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();

View File

@ -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"));
}
}

View File

@ -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;

View File

@ -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;