Trying to get rid of unused variables...

This commit is contained in:
Ilya Fedin 2021-03-14 00:08:07 +04:00 committed by John Preston
parent 12e306dd7b
commit ae0b9141dd
16 changed files with 8 additions and 19 deletions

View File

@ -464,7 +464,6 @@ void Rows::showMenu(int index) {
Fn<void()> 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); });
}

View File

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

View File

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

View File

@ -406,7 +406,6 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
mrows.push_back({ i->second });
}
} else if (_channel && _channel->isMegagroup()) {
QMultiMap<int32, UserData*> ordered;
if (_channel->lastParticipantsRequestNeeded()) {
_channel->session().api().requestLastParticipants(_channel);
} else {

View File

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

View File

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

View File

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

View File

@ -1183,8 +1183,6 @@ void ComposeControls::initAutocomplete() {
}
};
const auto insertMention = [=](not_null<UserData*> user) {
auto replacement = QString();
auto entityTag = QString();
if (user->username.isEmpty()) {
_field->insertTag(
user->firstName.isEmpty() ? user->name : user->firstName,

View File

@ -2004,7 +2004,7 @@ void ListWidget::performDrag() {
}
TextWithEntities sel;
QList<QUrl> urls;
//QList<QUrl> urls;
if (uponSelected) {
// sel = getSelectedText();
} else if (pressedHandler) {

View File

@ -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<Ui::PanelAnimation>(st::emojiPanAnimation, Ui::PanelAnimation::Origin::BottomLeft);
auto inner = rect().marginsRemoved(st::emojiPanMargins);

View File

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

View File

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

View File

@ -1669,7 +1669,6 @@ SessionPrivate::HandleResult SessionPrivate::handleOneReceived(
auto rFrom = originalRequest->constData() + 8;
const auto rEnd = originalRequest->constData() + originalRequest->size();
auto toAck = QVector<MTPlong>();
if (mtpTypeId(*rFrom) == mtpc_msgs_state_req) {
MTPMsgsStateReq request;
if (!request.read(rFrom, rEnd)) {

View File

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

View File

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

View File

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