Fix -Wunused-variable warnings
This commit is contained in:
parent
f0c474c6ae
commit
b8485c0d8a
16 changed files with 11 additions and 40 deletions
|
|
@ -416,7 +416,6 @@ void PanelAnimation::paintFrame(QPainter &p, int x, int y, int outerWidth, float
|
||||||
if (fadeTop != fadeBottom) {
|
if (fadeTop != fadeBottom) {
|
||||||
auto painterFadeTop = fadeTop / pixelRatio;
|
auto painterFadeTop = fadeTop / pixelRatio;
|
||||||
auto painterFrameWidth = frameWidth / pixelRatio;
|
auto painterFrameWidth = frameWidth / pixelRatio;
|
||||||
auto painterFrameHeight = frameHeight / pixelRatio;
|
|
||||||
p.drawPixmap(painterFrameLeft, painterFadeTop, painterFrameWidth, painterFadeBottom - painterFadeTop, _fadeMask, 0, fadeSkipLines, pixelRatio, fadeBottom - fadeTop);
|
p.drawPixmap(painterFrameLeft, painterFadeTop, painterFrameWidth, painterFadeBottom - painterFadeTop, _fadeMask, 0, fadeSkipLines, pixelRatio, fadeBottom - fadeTop);
|
||||||
}
|
}
|
||||||
if (fadeBottom != frameBottom) {
|
if (fadeBottom != frameBottom) {
|
||||||
|
|
@ -424,8 +423,6 @@ void PanelAnimation::paintFrame(QPainter &p, int x, int y, int outerWidth, float
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto frameInts = _frameInts + frameLeft + frameTop * _frameIntsPerLine;
|
|
||||||
auto frameIntsPerLineAdd = (_finalWidth - frameWidth) + _frameIntsPerLineAdded;
|
|
||||||
|
|
||||||
// Draw corners
|
// Draw corners
|
||||||
paintCorner(_topLeft, frameLeft, frameTop);
|
paintCorner(_topLeft, frameLeft, frameTop);
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,6 @@ RadialState InfiniteRadialAnimation::computeState() {
|
||||||
kFullArcLength };
|
kFullArcLength };
|
||||||
}
|
}
|
||||||
if (anim::Disabled()) {
|
if (anim::Disabled()) {
|
||||||
const auto shown = 1.;
|
|
||||||
return { 1., 0, kFullArcLength };
|
return { 1., 0, kFullArcLength };
|
||||||
}
|
}
|
||||||
const auto min = int(std::round(kFullArcLength * _st.arcMin));
|
const auto min = int(std::round(kFullArcLength * _st.arcMin));
|
||||||
|
|
@ -245,9 +244,6 @@ RadialState InfiniteRadialAnimation::computeState() {
|
||||||
const auto cycles = (now - _workStarted) / _st.sinePeriod;
|
const auto cycles = (now - _workStarted) / _st.sinePeriod;
|
||||||
const auto relative = (now - _workStarted) % _st.sinePeriod;
|
const auto relative = (now - _workStarted) % _st.sinePeriod;
|
||||||
const auto smallDuration = _st.sineShift - _st.sineDuration;
|
const auto smallDuration = _st.sineShift - _st.sineDuration;
|
||||||
const auto largeDuration = _st.sinePeriod
|
|
||||||
- _st.sineShift
|
|
||||||
- _st.sineDuration;
|
|
||||||
const auto basic = int((linear
|
const auto basic = int((linear
|
||||||
+ min
|
+ min
|
||||||
+ (cycles * (kFullArcLength + min - max))) % kFullArcLength);
|
+ (cycles * (kFullArcLength + min - max))) % kFullArcLength);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,9 @@ constexpr auto kSetVersion = uint32(2);
|
||||||
constexpr auto kCacheVersion = uint32(6);
|
constexpr auto kCacheVersion = uint32(6);
|
||||||
constexpr auto kMaxId = uint32(1 << 8);
|
constexpr auto kMaxId = uint32(1 << 8);
|
||||||
|
|
||||||
|
#if defined Q_OS_MAC && !defined OS_MAC_OLD
|
||||||
constexpr auto kScaleForTouchBar = 150;
|
constexpr auto kScaleForTouchBar = 150;
|
||||||
|
#endif
|
||||||
|
|
||||||
enum class ConfigResult {
|
enum class ConfigResult {
|
||||||
Invalid,
|
Invalid,
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,16 @@
|
||||||
#include <QtGui/QOpenGLFunctions>
|
#include <QtGui/QOpenGLFunctions>
|
||||||
#include <QtWidgets/QOpenGLWidget>
|
#include <QtWidgets/QOpenGLWidget>
|
||||||
|
|
||||||
#define LOG_ONCE(x) static auto logged = [&] { LOG(x); return true; }();
|
#define LOG_ONCE(x) [[maybe_unused]] static auto logged = [&] { LOG(x); return true; }();
|
||||||
|
|
||||||
namespace Ui::GL {
|
namespace Ui::GL {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool ForceDisabled/* = false*/;
|
bool ForceDisabled/* = false*/;
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
ANGLE ResolvedANGLE = ANGLE::Auto;
|
ANGLE ResolvedANGLE = ANGLE::Auto;
|
||||||
|
#endif // Q_OS_WIN
|
||||||
|
|
||||||
void CrashCheckStart() {
|
void CrashCheckStart() {
|
||||||
auto f = QFile(Integration::Instance().openglCheckFilePath());
|
auto f = QFile(Integration::Instance().openglCheckFilePath());
|
||||||
|
|
@ -102,7 +104,7 @@ Capabilities CheckCapabilities(QWidget *widget) {
|
||||||
LOG_ONCE(("OpenGL Profile: Compatibility."));
|
LOG_ONCE(("OpenGL Profile: Compatibility."));
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
static const auto extensionsLogged = [&] {
|
[[maybe_unused]] static const auto extensionsLogged = [&] {
|
||||||
const auto renderer = reinterpret_cast<const char*>(
|
const auto renderer = reinterpret_cast<const char*>(
|
||||||
functions->glGetString(GL_RENDERER));
|
functions->glGetString(GL_RENDERER));
|
||||||
LOG(("OpenGL Renderer: %1").arg(renderer ? renderer : "[nullptr]"));
|
LOG(("OpenGL Renderer: %1").arg(renderer ? renderer : "[nullptr]"));
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ QImage prepareBlur(QImage img) {
|
||||||
|
|
||||||
uchar *pix = img.bits();
|
uchar *pix = img.bits();
|
||||||
if (pix) {
|
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 radius = 3;
|
||||||
const int r1 = radius + 1;
|
const int r1 = radius + 1;
|
||||||
const int div = radius * 2 + 1;
|
const int div = radius * 2 + 1;
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,6 @@ void BoxContent::setInnerTopSkip(int innerTopSkip, bool scrollBottomFixed) {
|
||||||
|
|
||||||
void BoxContent::setInnerBottomSkip(int innerBottomSkip) {
|
void BoxContent::setInnerBottomSkip(int innerBottomSkip) {
|
||||||
if (_innerBottomSkip != innerBottomSkip) {
|
if (_innerBottomSkip != innerBottomSkip) {
|
||||||
auto delta = innerBottomSkip - _innerBottomSkip;
|
|
||||||
_innerBottomSkip = innerBottomSkip;
|
_innerBottomSkip = innerBottomSkip;
|
||||||
if (_scroll && width() > 0) {
|
if (_scroll && width() > 0) {
|
||||||
updateScrollAreaGeometry();
|
updateScrollAreaGeometry();
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ void BasicWindowHelper::setupBodyTitleAreaEvents() {
|
||||||
== Qt::LeftButton)) {
|
== Qt::LeftButton)) {
|
||||||
_mousePressed = true;
|
_mousePressed = true;
|
||||||
} else if (e->type() == QEvent::MouseMove) {
|
} else if (e->type() == QEvent::MouseMove) {
|
||||||
const auto mouseEvent = static_cast<QMouseEvent*>(e.get());
|
|
||||||
if (_mousePressed
|
if (_mousePressed
|
||||||
#ifndef Q_OS_WIN // We handle fullscreen startSystemMove() only on Windows.
|
#ifndef Q_OS_WIN // We handle fullscreen startSystemMove() only on Windows.
|
||||||
&& !_window->isFullScreen()
|
&& !_window->isFullScreen()
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ void colorizeImage(const QImage &src, QColor c, QImage *outResult, QRect srcRect
|
||||||
|
|
||||||
auto pattern = anim::shifted(c);
|
auto pattern = anim::shifted(c);
|
||||||
|
|
||||||
auto resultBytesPerPixel = (src.depth() >> 3);
|
|
||||||
constexpr auto resultIntsPerPixel = 1;
|
constexpr auto resultIntsPerPixel = 1;
|
||||||
auto resultIntsPerLine = (outResult->bytesPerLine() >> 2);
|
auto resultIntsPerLine = (outResult->bytesPerLine() >> 2);
|
||||||
auto resultIntsAdded = resultIntsPerLine - width * resultIntsPerPixel;
|
auto resultIntsAdded = resultIntsPerLine - width * resultIntsPerPixel;
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ TextWithEntities PrepareRichFromRich(
|
||||||
int32 i = 0, l = preparsed.size();
|
int32 i = 0, l = preparsed.size();
|
||||||
result.entities.clear();
|
result.entities.clear();
|
||||||
result.entities.reserve(l);
|
result.entities.reserve(l);
|
||||||
const QChar s = result.text.size();
|
|
||||||
for (; i < l; ++i) {
|
for (; i < l; ++i) {
|
||||||
auto type = preparsed.at(i).type();
|
auto type = preparsed.at(i).type();
|
||||||
if (((type == EntityType::Mention || type == EntityType::MentionName) && !parseMentions) ||
|
if (((type == EntityType::Mention || type == EntityType::MentionName) && !parseMentions) ||
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,6 @@ void BlockParser::parseWords(QFixed minResizeWidth, int blockFrom) {
|
||||||
int item = -1;
|
int item = -1;
|
||||||
int newItem = eng->findItem(0);
|
int newItem = eng->findItem(0);
|
||||||
|
|
||||||
style::align alignment = eng->option.alignment();
|
|
||||||
|
|
||||||
const QCharAttributes *attributes = eng->attributes();
|
const QCharAttributes *attributes = eng->attributes();
|
||||||
if (!attributes)
|
if (!attributes)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1315,7 +1315,7 @@ QString EscapeForRichParsing(const QString &text) {
|
||||||
|
|
||||||
QString SingleLine(const QString &text) {
|
QString SingleLine(const QString &text) {
|
||||||
auto result = 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.
|
// Trim.
|
||||||
while (s < e && IsTrimmed(*s)) {
|
while (s < e && IsTrimmed(*s)) {
|
||||||
|
|
@ -1405,7 +1405,6 @@ QStringList PrepareSearchWords(
|
||||||
? *SplitterOverride
|
? *SplitterOverride
|
||||||
: RegExpWordSplit(),
|
: RegExpWordSplit(),
|
||||||
base::QStringSkipEmptyParts);
|
base::QStringSkipEmptyParts);
|
||||||
auto size = list.size();
|
|
||||||
result.reserve(list.size());
|
result.reserve(list.size());
|
||||||
for (const auto &word : std::as_const(list)) {
|
for (const auto &word : std::as_const(list)) {
|
||||||
auto trimmed = word.trimmed();
|
auto trimmed = word.trimmed();
|
||||||
|
|
@ -2196,7 +2195,6 @@ EntitiesInText ConvertTextTagsToEntities(const TextWithTags::Tags &tags) {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
auto till = offset;
|
|
||||||
for (const auto &tag : tags) {
|
for (const auto &tag : tags) {
|
||||||
if (tag.offset > offset) {
|
if (tag.offset > offset) {
|
||||||
processState(State());
|
processState(State());
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,6 @@ void Widget::mouseMoveEvent(QMouseEvent *e) {
|
||||||
}
|
}
|
||||||
const auto point = e->pos()
|
const auto point = e->pos()
|
||||||
- QPoint(_st->padding.left(), _textTop);
|
- QPoint(_st->padding.left(), _textTop);
|
||||||
const auto lines = _maxTextHeight / _st->style.font->height;
|
|
||||||
const auto state = _text.getStateElided(point, _textWidth + 1);
|
const auto state = _text.getStateElided(point, _textWidth + 1);
|
||||||
const auto was = ClickHandler::getActive();
|
const auto was = ClickHandler::getActive();
|
||||||
if (was != state.link) {
|
if (was != state.link) {
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,6 @@ void Checkbox::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
|
|
||||||
auto check = checkRect();
|
auto check = checkRect();
|
||||||
auto ms = crl::now();
|
|
||||||
auto active = _check->currentAnimationValue();
|
auto active = _check->currentAnimationValue();
|
||||||
if (isDisabled()) {
|
if (isDisabled()) {
|
||||||
p.setOpacity(_st.disabledOpacity);
|
p.setOpacity(_st.disabledOpacity);
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,6 @@
|
||||||
#include "ui/image/image_prepare.h"
|
#include "ui/image/image_prepare.h"
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
constexpr float64 kFadeHeight = 1. / 3;
|
|
||||||
constexpr int kFadeAlphaMax = 160;
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
InnerDropdown::InnerDropdown(
|
InnerDropdown::InnerDropdown(
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,6 @@ bool IsNewline(QChar ch) {
|
||||||
auto resultLink = QString();
|
auto resultLink = QString();
|
||||||
const auto checkingLink = (tag == kTagCheckLinkMeta);
|
const auto checkingLink = (tag == kTagCheckLinkMeta);
|
||||||
const auto &text = textWithTags.text;
|
const auto &text = textWithTags.text;
|
||||||
const auto &tags = textWithTags.tags;
|
|
||||||
auto from = 0;
|
auto from = 0;
|
||||||
auto till = int(text.size());
|
auto till = int(text.size());
|
||||||
const auto adjust = [&] {
|
const auto adjust = [&] {
|
||||||
|
|
@ -1038,8 +1037,7 @@ void FlatInput::touchEvent(QTouchEvent *e) {
|
||||||
if (!_touchPress) return;
|
if (!_touchPress) return;
|
||||||
auto weak = MakeWeak(this);
|
auto weak = MakeWeak(this);
|
||||||
if (!_touchMove && window()) {
|
if (!_touchMove && window()) {
|
||||||
Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
|
QPoint mapped(mapFromGlobal(_touchStart));
|
||||||
QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
|
|
||||||
|
|
||||||
if (_touchRightButton) {
|
if (_touchRightButton) {
|
||||||
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
||||||
|
|
@ -1077,7 +1075,6 @@ void FlatInput::finishAnimations() {
|
||||||
void FlatInput::paintEvent(QPaintEvent *e) {
|
void FlatInput::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
|
|
||||||
auto ms = crl::now();
|
|
||||||
auto placeholderFocused = _placeholderFocusedAnimation.value(_focused ? 1. : 0.);
|
auto placeholderFocused = _placeholderFocusedAnimation.value(_focused ? 1. : 0.);
|
||||||
auto pen = anim::pen(_st.borderColor, _st.borderActive, placeholderFocused);
|
auto pen = anim::pen(_st.borderColor, _st.borderActive, placeholderFocused);
|
||||||
pen.setWidth(_st.borderWidth);
|
pen.setWidth(_st.borderWidth);
|
||||||
|
|
@ -1650,8 +1647,7 @@ void InputField::handleTouchEvent(QTouchEvent *e) {
|
||||||
if (!_touchPress) return;
|
if (!_touchPress) return;
|
||||||
auto weak = MakeWeak(this);
|
auto weak = MakeWeak(this);
|
||||||
if (!_touchMove && window()) {
|
if (!_touchMove && window()) {
|
||||||
Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
|
QPoint mapped(mapFromGlobal(_touchStart));
|
||||||
QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
|
|
||||||
|
|
||||||
if (_touchRightButton) {
|
if (_touchRightButton) {
|
||||||
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
||||||
|
|
@ -2280,9 +2276,6 @@ void InputField::onDocumentContentsChange(
|
||||||
? _realCharsAdded
|
? _realCharsAdded
|
||||||
: charsAdded;
|
: charsAdded;
|
||||||
|
|
||||||
const auto removePosition = position;
|
|
||||||
const auto removeLength = charsRemoved;
|
|
||||||
|
|
||||||
_correcting = true;
|
_correcting = true;
|
||||||
QTextCursor(document->docHandle(), 0).joinPreviousEditBlock();
|
QTextCursor(document->docHandle(), 0).joinPreviousEditBlock();
|
||||||
const auto guard = gsl::finally([&] {
|
const auto guard = gsl::finally([&] {
|
||||||
|
|
@ -3855,8 +3848,7 @@ void MaskedInputField::touchEvent(QTouchEvent *e) {
|
||||||
if (!_touchPress) return;
|
if (!_touchPress) return;
|
||||||
auto weak = MakeWeak(this);
|
auto weak = MakeWeak(this);
|
||||||
if (!_touchMove && window()) {
|
if (!_touchMove && window()) {
|
||||||
Qt::MouseButton btn(_touchRightButton ? Qt::RightButton : Qt::LeftButton);
|
QPoint mapped(mapFromGlobal(_touchStart));
|
||||||
QPoint mapped(mapFromGlobal(_touchStart)), winMapped(window()->mapFromGlobal(_touchStart));
|
|
||||||
|
|
||||||
if (_touchRightButton) {
|
if (_touchRightButton) {
|
||||||
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
QContextMenuEvent contextEvent(QContextMenuEvent::Mouse, mapped, _touchStart);
|
||||||
|
|
|
||||||
|
|
@ -551,7 +551,6 @@ bool FlatLabel::eventHook(QEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlatLabel::touchEvent(QTouchEvent *e) {
|
void FlatLabel::touchEvent(QTouchEvent *e) {
|
||||||
const Qt::TouchPointStates &states(e->touchPointStates());
|
|
||||||
if (e->type() == QEvent::TouchCancel) { // cancel
|
if (e->type() == QEvent::TouchCancel) { // cancel
|
||||||
if (!_touchInProgress) return;
|
if (!_touchInProgress) return;
|
||||||
_touchInProgress = false;
|
_touchInProgress = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue