Fix -Wunused-variable warnings with gcc

This commit is contained in:
Ilya Fedin 2021-07-14 02:16:03 +04:00 committed by John Preston
parent 3d1a049405
commit ba9b72e038
31 changed files with 46 additions and 150 deletions

View file

@ -115,12 +115,12 @@ private:
const Rows::Row &rowBySelection(Selection selected) const; const Rows::Row &rowBySelection(Selection selected) const;
std::unique_ptr<Ui::RippleAnimation> &rippleBySelection( std::unique_ptr<Ui::RippleAnimation> &rippleBySelection(
Selection selected); Selection selected);
const std::unique_ptr<Ui::RippleAnimation> &rippleBySelection( [[maybe_unused]] const std::unique_ptr<Ui::RippleAnimation> &rippleBySelection(
Selection selected) const; Selection selected) const;
std::unique_ptr<Ui::RippleAnimation> &rippleBySelection( std::unique_ptr<Ui::RippleAnimation> &rippleBySelection(
not_null<Row*> row, not_null<Row*> row,
Selection selected); Selection selected);
const std::unique_ptr<Ui::RippleAnimation> &rippleBySelection( [[maybe_unused]] const std::unique_ptr<Ui::RippleAnimation> &rippleBySelection(
not_null<const Row*> row, not_null<const Row*> row,
Selection selected) const; Selection selected) const;
void addRipple(Selection selected, QPoint position); void addRipple(Selection selected, QPoint position);

View file

@ -129,9 +129,6 @@ private:
const QString &text, const QString &text,
rpl::producer<QString> about); rpl::producer<QString> about);
bool inviteLinkShown();
QString inviteLinkText();
not_null<PeerData*> _peer; not_null<PeerData*> _peer;
bool _linkOnly = false; bool _linkOnly = false;
@ -308,15 +305,6 @@ QString Controller::getUsernameInput() {
return _controls.usernameInput->getLastText().trimmed(); return _controls.usernameInput->getLastText().trimmed();
} }
QString Controller::inviteLinkText() {
if (const auto channel = _peer->asChannel()) {
return channel->inviteLink();
} else if (const auto chat = _peer->asChat()) {
return chat->inviteLink();
}
return QString();
}
object_ptr<Ui::RpWidget> Controller::createUsernameEdit() { object_ptr<Ui::RpWidget> Controller::createUsernameEdit() {
Expects(_wrap != nullptr); Expects(_wrap != nullptr);
@ -583,11 +571,6 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkBlock() {
return result; return result;
} }
bool Controller::inviteLinkShown() {
return !_controls.privacy
|| (_controls.privacy->value() == Privacy::NoUsername);
}
} // namespace } // namespace
EditPeerTypeBox::EditPeerTypeBox( EditPeerTypeBox::EditPeerTypeBox(

View file

@ -761,7 +761,6 @@ void StickerSetBox::Inner::visibleTopBottomUpdated(
void StickerSetBox::Inner::setupLottie(int index) { void StickerSetBox::Inner::setupLottie(int index) {
auto &element = _elements[index]; auto &element = _elements[index];
const auto document = element.document;
element.animated = ChatHelpers::LottieAnimationFromDocument( element.animated = ChatHelpers::LottieAnimationFromDocument(
getLottiePlayer(), getLottiePlayer(),

View file

@ -335,7 +335,6 @@ void ChooseJoinAsProcess::start(
}, _request->lifetime); }, _request->lifetime);
const auto finish = [=](JoinInfo info) { const auto finish = [=](JoinInfo info) {
const auto peer = _request->peer;
const auto done = std::move(_request->done); const auto done = std::move(_request->done);
const auto box = _request->box; const auto box = _request->box;
_request = nullptr; _request = nullptr;

View file

@ -1171,21 +1171,6 @@ int Members::Controller::rowPaintStatusIcon(
: state.raisedHand : state.raisedHand
? st::groupCallMemberInactiveStatus->c ? st::groupCallMemberInactiveStatus->c
: iconColor; : iconColor;
const auto color = (state.speaking == 1. && !state.mutedByMe)
? st::groupCallMemberActiveStatus->c
: (state.speaking == 0.
? (state.active == 1.
? st::groupCallMemberNotJoinedStatus->c
: (state.active == 0.
? (state.muted == 1.
? (state.raisedHand
? st::groupCallMemberInactiveStatus->c
: st::groupCallMemberNotJoinedStatus->c)
: (state.muted == 0.
? st::groupCallMemberNotJoinedStatus->c
: other))
: other))
: other);
if (camera) { if (camera) {
st::groupCallNarrowCameraIcon.paint(p, x, y, outerWidth, other); st::groupCallNarrowCameraIcon.paint(p, x, y, outerWidth, other);
x += st::groupCallNarrowCameraIcon.width(); x += st::groupCallNarrowCameraIcon.width();

View file

@ -1033,7 +1033,6 @@ void GifsListWidget::updateSelected() {
int row = -1, col = -1, sel = -1; int row = -1, col = -1, sel = -1;
ClickHandlerPtr lnk; ClickHandlerPtr lnk;
ClickHandlerHost *lnkhost = nullptr; ClickHandlerHost *lnkhost = nullptr;
HistoryView::CursorState cursor = HistoryView::CursorState::None;
if (sy >= 0) { if (sy >= 0) {
row = 0; row = 0;
for (int rows = _rows.size(); row < rows; ++row) { for (int rows = _rows.size(); row < rows; ++row) {
@ -1062,7 +1061,6 @@ void GifsListWidget::updateSelected() {
QPoint(sx, sy), QPoint(sx, sy),
HistoryView::StateRequest()); HistoryView::StateRequest());
lnk = result.link; lnk = result.link;
cursor = result.cursor;
lnkhost = inlineItems[col]; lnkhost = inlineItems[col];
} else { } else {
row = col = -1; row = col = -1;

View file

@ -1880,7 +1880,6 @@ void StickersListWidget::ensureLottiePlayer(Set &set) {
void StickersListWidget::setupLottie(Set &set, int section, int index) { void StickersListWidget::setupLottie(Set &set, int section, int index) {
auto &sticker = set.stickers[index]; auto &sticker = set.stickers[index];
const auto document = sticker.document;
ensureLottiePlayer(set); ensureLottiePlayer(set);
// Document should be loaded already for the animation to be set up. // Document should be loaded already for the animation to be set up.

View file

@ -63,7 +63,7 @@ enum class Command {
SupportHistoryForward, SupportHistoryForward,
}; };
constexpr auto kShowFolder = { [[maybe_unused]] constexpr auto kShowFolder = {
Command::ShowAllChats, Command::ShowAllChats,
Command::ShowFolder1, Command::ShowFolder1,
Command::ShowFolder2, Command::ShowFolder2,

View file

@ -98,25 +98,27 @@ QString FileExtension(const QString &filepath) {
return QString(last.base(), last - reversed.begin()); return QString(last.base(), last - reversed.begin());
} }
// bool IsValidMediaFile(const QString &filepath) { #if 0
// static const auto kExtensions = [] { bool IsValidMediaFile(const QString &filepath) {
// const auto list = qsl("\ static const auto kExtensions = [] {
// 16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \ const auto list = qsl("\
// avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \ 16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \
// dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \ avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \
// ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \ dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \
// mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \ ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \
// niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \ mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \
// qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \ niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \
// swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \ qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \
// wv xm xml ym yuv").split(' '); swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \
// return base::flat_set<QString>(list.begin(), list.end()); wv xm xml ym yuv").split(' ');
// }(); return base::flat_set<QString>(list.begin(), list.end());
}();
// return ranges::binary_search( return ranges::binary_search(
// kExtensions, kExtensions,
// FileExtension(filepath).toLower()); FileExtension(filepath).toLower());
// } }
#endif
bool IsExecutableName(const QString &filepath) { bool IsExecutableName(const QString &filepath) {
static const auto kExtensions = [] { static const auto kExtensions = [] {

View file

@ -1248,14 +1248,12 @@ bool InnerWidget::pinnedShiftAnimationCallback(crl::time now) {
now += st::stickersRowDuration; now += st::stickersRowDuration;
} }
auto wasAnimating = false;
auto animating = false; auto animating = false;
auto updateMin = -1; auto updateMin = -1;
auto updateMax = 0; auto updateMax = 0;
for (auto i = 0, l = static_cast<int>(_pinnedRows.size()); i != l; ++i) { for (auto i = 0, l = static_cast<int>(_pinnedRows.size()); i != l; ++i) {
auto start = _pinnedRows[i].animStartTime; auto start = _pinnedRows[i].animStartTime;
if (start) { if (start) {
wasAnimating = true;
if (updateMin < 0) updateMin = i; if (updateMin < 0) updateMin = i;
updateMax = i; updateMax = i;
if (start + st::stickersRowDuration > now && now >= start) { if (start + st::stickersRowDuration > now && now >= start) {

View file

@ -32,7 +32,6 @@ public:
return _check->checked(); return _check->checked();
} }
rpl::producer<bool> checkedChanges() const; rpl::producer<bool> checkedChanges() const;
rpl::producer<bool> checkedValue() const;
enum class NotifyAboutChange { enum class NotifyAboutChange {
Notify, Notify,
@ -42,8 +41,6 @@ public:
bool checked, bool checked,
NotifyAboutChange notify = NotifyAboutChange::Notify); NotifyAboutChange notify = NotifyAboutChange::Notify);
void finishAnimating();
QMargins getMargins() const override { QMargins getMargins() const override {
return _st.margin; return _st.margin;
} }
@ -90,10 +87,6 @@ rpl::producer<bool> UserCheckbox::checkedChanges() const {
return _checkedChanges.events(); return _checkedChanges.events();
} }
rpl::producer<bool> UserCheckbox::checkedValue() const {
return _checkedChanges.events_starting_with(checked());
}
void UserCheckbox::setChecked(bool checked, NotifyAboutChange notify) { void UserCheckbox::setChecked(bool checked, NotifyAboutChange notify) {
if (_check->checked() != checked) { if (_check->checked() != checked) {
_check->setChecked(checked, anim::type::normal); _check->setChecked(checked, anim::type::normal);
@ -133,10 +126,6 @@ void UserCheckbox::paintEvent(QPaintEvent *e) {
p.drawTextLeft(statusLeft, statusTop, width(), _statusText); p.drawTextLeft(statusLeft, statusTop, width(), _statusText);
} }
void UserCheckbox::finishAnimating() {
_check->finishAnimating();
}
int UserCheckbox::resizeGetHeight(int newWidth) { int UserCheckbox::resizeGetHeight(int newWidth) {
return st::contactsPhotoSize; return st::contactsPhotoSize;
} }

View file

@ -1637,7 +1637,7 @@ void InnerWidget::updateSelected() {
dragState = view->textState(itemPoint, request); dragState = view->textState(itemPoint, request);
lnkhost = view; lnkhost = view;
if (!dragState.link && itemPoint.x() >= st::historyPhotoLeft && itemPoint.x() < st::historyPhotoLeft + st::msgPhotoSize) { if (!dragState.link && itemPoint.x() >= st::historyPhotoLeft && itemPoint.x() < st::historyPhotoLeft + st::msgPhotoSize) {
if (auto message = item->toHistoryMessage()) { if (item->toHistoryMessage()) {
if (view->hasFromPhoto()) { if (view->hasFromPhoto()) {
enumerateUserpics([&](not_null<Element*> view, int userpicTop) { enumerateUserpics([&](not_null<Element*> view, int userpicTop) {
// stop enumeration if the userpic is below our point // stop enumeration if the userpic is below our point

View file

@ -2823,7 +2823,7 @@ void HistoryInner::mouseActionUpdate() {
_dragStateItem = session().data().message(dragState.itemId); _dragStateItem = session().data().message(dragState.itemId);
lnkhost = view; lnkhost = view;
if (!dragState.link && m.x() >= st::historyPhotoLeft && m.x() < st::historyPhotoLeft + st::msgPhotoSize) { if (!dragState.link && m.x() >= st::historyPhotoLeft && m.x() < st::historyPhotoLeft + st::msgPhotoSize) {
if (auto msg = item->toHistoryMessage()) { if (item->toHistoryMessage()) {
if (view->hasFromPhoto()) { if (view->hasFromPhoto()) {
enumerateUserpics([&](not_null<Element*> view, int userpicTop) -> bool { enumerateUserpics([&](not_null<Element*> view, int userpicTop) -> bool {
// stop enumeration if the userpic is below our point // stop enumeration if the userpic is below our point

View file

@ -81,12 +81,11 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m
accumulate_min(paintw, maxWidth()); accumulate_min(paintw, maxWidth());
auto nameleft = 0, nametop = 0, nameright = 0, statustop = 0; auto nameleft = 0, nametop = 0, statustop = 0;
auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus; auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
nameleft = st::historyCallLeft; nameleft = st::historyCallLeft;
nametop = st::historyCallTop - topMinus; nametop = st::historyCallTop - topMinus;
nameright = st::msgFileLayout.padding.left();
statustop = st::historyCallStatusTop - topMinus; statustop = st::historyCallStatusTop - topMinus;
p.setFont(st::semiboldFont); p.setFont(st::semiboldFont);

View file

@ -125,9 +125,9 @@ void InnerWidget::createTypeButtons() {
addMediaButton(Type::MusicFile, st::infoIconMediaAudio); addMediaButton(Type::MusicFile, st::infoIconMediaAudio);
addMediaButton(Type::Link, st::infoIconMediaLink); addMediaButton(Type::Link, st::infoIconMediaLink);
addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice); addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice);
if (auto user = _controller->key().peer()->asUser()) { // if (auto user = _controller->key().peer()->asUser()) {
// addCommonGroupsButton(user, st::infoIconMediaGroup); // addCommonGroupsButton(user, st::infoIconMediaGroup);
} // }
content->add(object_ptr<Ui::FixedHeightWidget>( content->add(object_ptr<Ui::FixedHeightWidget>(
content, content,

View file

@ -458,7 +458,6 @@ ActionsFiller::ActionsFiller(
void ActionsFiller::addInviteToGroupAction( void ActionsFiller::addInviteToGroupAction(
not_null<UserData*> user) { not_null<UserData*> user) {
const auto controller = _controller;
AddActionButton( AddActionButton(
_wrap, _wrap,
tr::lng_profile_invite_to_group(), tr::lng_profile_invite_to_group(),

View file

@ -198,7 +198,7 @@ ClickHandlerPtr ItemBase::getResultPreviewHandler() const {
_result->_content_url, _result->_content_url,
false); false);
} else if (const auto document = _result->_document } else if (const auto document = _result->_document
&& _result->_document->createMediaView()->canBePlayed()) { ; document->createMediaView()->canBePlayed()) {
return std::make_shared<OpenFileClickHandler>(); return std::make_shared<OpenFileClickHandler>();
} else if (_result->_photo) { } else if (_result->_photo) {
return std::make_shared<OpenFileClickHandler>(); return std::make_shared<OpenFileClickHandler>();

View file

@ -677,7 +677,6 @@ void Inner::updateSelected() {
int row = -1, col = -1, sel = -1; int row = -1, col = -1, sel = -1;
ClickHandlerPtr lnk; ClickHandlerPtr lnk;
ClickHandlerHost *lnkhost = nullptr; ClickHandlerHost *lnkhost = nullptr;
HistoryView::CursorState cursor = HistoryView::CursorState::None;
if (sy >= 0) { if (sy >= 0) {
row = 0; row = 0;
for (int rows = _rows.size(); row < rows; ++row) { for (int rows = _rows.size(); row < rows; ++row) {
@ -706,7 +705,6 @@ void Inner::updateSelected() {
QPoint(sx, sy), QPoint(sx, sy),
HistoryView::StateRequest()); HistoryView::StateRequest());
lnk = result.link; lnk = result.link;
cursor = result.cursor;
lnkhost = inlineItems[col]; lnkhost = inlineItems[col];
} else { } else {
row = col = -1; row = col = -1;

View file

@ -478,12 +478,11 @@ void Widget::handleSongUpdate(const TrackState &state) {
} }
void Widget::updateTimeText(const TrackState &state) { void Widget::updateTimeText(const TrackState &state) {
qint64 position = 0, length = 0, display = 0; qint64 display = 0;
const auto frequency = state.frequency; const auto frequency = state.frequency;
const auto document = state.id.audio(); const auto document = state.id.audio();
if (!IsStoppedOrStopping(state.state)) { if (!IsStoppedOrStopping(state.state)) {
display = position = state.position; display = state.position;
length = state.length;
} else if (state.length) { } else if (state.length) {
display = state.length; display = state.length;
} else if (const auto song = document->song()) { } else if (const auto song = document->song()) {

View file

@ -2439,7 +2439,7 @@ void OverlayWidget::displayDocument(
_docIconRect = QRect((width() - st::mediaviewFileIconSize) / 2, (height() - st::mediaviewFileIconSize) / 2, st::mediaviewFileIconSize, st::mediaviewFileIconSize); _docIconRect = QRect((width() - st::mediaviewFileIconSize) / 2, (height() - st::mediaviewFileIconSize) / 2, st::mediaviewFileIconSize, st::mediaviewFileIconSize);
int32 colorIndex = documentColorIndex(_document, _docExt); int32 colorIndex = documentColorIndex(_document, _docExt);
_docIconColor = documentColor(colorIndex); _docIconColor = documentColor(colorIndex);
const style::icon *(thumbs[]) = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow }; const style::icon *thumbs[] = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow };
_docIcon = thumbs[colorIndex]; _docIcon = thumbs[colorIndex];
int32 extmaxw = (st::mediaviewFileIconSize - st::mediaviewFileExtPadding * 2); int32 extmaxw = (st::mediaviewFileIconSize - st::mediaviewFileExtPadding * 2);
@ -3429,7 +3429,7 @@ void OverlayWidget::paintThemePreviewContent(
width(), width(),
st::themePreviewMargin.top()); st::themePreviewMargin.top());
} }
if (const auto fillTitleRect = (titleRect.y() < 0)) { if (titleRect.y() < 0) {
titleRect.moveTop(0); titleRect.moveTop(0);
fillOverlay(titleRect); fillOverlay(titleRect);
} }
@ -3457,8 +3457,7 @@ void OverlayWidget::paintThemePreviewContent(
outer.y() + outer.height() - st::themePreviewMargin.bottom(), outer.y() + outer.height() - st::themePreviewMargin.bottom(),
outer.width(), outer.width(),
st::themePreviewMargin.bottom()); st::themePreviewMargin.bottom());
if (const auto fillButtonsRect if (buttonsRect.y() + buttonsRect.height() > height()) {
= (buttonsRect.y() + buttonsRect.height() > height())) {
buttonsRect.moveTop(height() - buttonsRect.height()); buttonsRect.moveTop(height() - buttonsRect.height());
fillOverlay(buttonsRect); fillOverlay(buttonsRect);
} }

View file

@ -109,7 +109,6 @@ DcKeyBindState DcKeyBinder::handleResponse(const mtpBuffer &response) {
auto from = response.begin(); auto from = response.begin();
const auto end = from + response.size(); const auto end = from + response.size();
auto error = MTPRpcError(); auto error = MTPRpcError();
auto result = MTPBool();
if (response[0] == mtpc_boolTrue) { if (response[0] == mtpc_boolTrue) {
return DcKeyBindState::Success; return DcKeyBindState::Success;
} else if (response[0] == mtpc_rpc_error && error.read(from, end)) { } else if (response[0] == mtpc_rpc_error && error.read(from, end)) {

View file

@ -314,10 +314,10 @@ auto ConcurrentSender::SpecificRequestBuilder<Request>::done(
Handler, Handler,
mtpRequestId, mtpRequestId,
Result>; Result>;
constexpr auto takesResponse = rpl::details::is_callable_plain_v< [[maybe_unused]] constexpr auto takesResponse = rpl::details::is_callable_plain_v<
Handler, Handler,
Result>; Result>;
constexpr auto takesNone = rpl::details::is_callable_plain_v<Handler>; [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v<Handler>;
if constexpr (takesFull) { if constexpr (takesFull) {
setDoneHandler<Result>(std::forward<Handler>(handler)); setDoneHandler<Result>(std::forward<Handler>(handler));
@ -348,10 +348,10 @@ auto ConcurrentSender::SpecificRequestBuilder<Request>::fail(
Handler, Handler,
mtpRequestId, mtpRequestId,
Error>; Error>;
constexpr auto takesError = rpl::details::is_callable_plain_v< [[maybe_unused]] constexpr auto takesError = rpl::details::is_callable_plain_v<
Handler, Handler,
Error>; Error>;
constexpr auto takesNone = rpl::details::is_callable_plain_v<Handler>; [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v<Handler>;
if constexpr (takesFull) { if constexpr (takesFull) {
setFailHandler(std::forward<Handler>(handler)); setFailHandler(std::forward<Handler>(handler));

View file

@ -58,7 +58,7 @@ const BuiltInDc kBuiltInDcsIPv6Test[] = {
{ 3, "2001:0b28:f23d:f003:0000:0000:0000:000e", 443 } { 3, "2001:0b28:f23d:f003:0000:0000:0000:000e", 443 }
}; };
const char *(kTestPublicRSAKeys[]) = { "\ const char *kTestPublicRSAKeys[] = { "\
-----BEGIN RSA PUBLIC KEY-----\n\ -----BEGIN RSA PUBLIC KEY-----\n\
MIIBCgKCAQEAyMEdY1aR+sCR3ZSJrtztKTKqigvO/vBfqACJLZtS7QMgCGXJ6XIR\n\ MIIBCgKCAQEAyMEdY1aR+sCR3ZSJrtztKTKqigvO/vBfqACJLZtS7QMgCGXJ6XIR\n\
yy7mx66W0/sOFa7/1mAZtEoIokDP3ShoqF4fVNb6XeqgQfaUHd8wJpDWHcR2OFwv\n\ yy7mx66W0/sOFa7/1mAZtEoIokDP3ShoqF4fVNb6XeqgQfaUHd8wJpDWHcR2OFwv\n\
@ -68,7 +68,7 @@ aHWfYmlEGepfaYR8Q0YqvvhYtMte3ITnuSJs171+GDqpdKcSwHnd6FudwGO4pcCO\n\
j4WcDuXc2CTHgH8gFTNhp/Y8/SpDOhvn9QIDAQAB\n\ j4WcDuXc2CTHgH8gFTNhp/Y8/SpDOhvn9QIDAQAB\n\
-----END RSA PUBLIC KEY-----" }; -----END RSA PUBLIC KEY-----" };
const char *(kPublicRSAKeys[]) = { "\ const char *kPublicRSAKeys[] = { "\
-----BEGIN RSA PUBLIC KEY-----\n\ -----BEGIN RSA PUBLIC KEY-----\n\
MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n\ MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n\
5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n\ 5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n\

View file

@ -176,20 +176,14 @@ public:
} }
} }
bool defaultNameFilterDisables() const;
QUrl directory() const; QUrl directory() const;
void setDirectory(const QUrl &directory); void setDirectory(const QUrl &directory);
void selectFile(const QUrl &filename); void selectFile(const QUrl &filename);
QList<QUrl> selectedFiles() const; QList<QUrl> selectedFiles() const;
void setFilter();
void selectNameFilter(const QString &filter);
QString selectedNameFilter() const;
void selectMimeTypeFilter(const QString &filter);
QString selectedMimeTypeFilter() const;
int exec() override; int exec() override;
bool failedToOpen() { bool failedToOpen() const {
return _failedToOpen; return _failedToOpen;
} }
@ -517,10 +511,6 @@ void XDPFileDialog::openPortal() {
} }
} }
bool XDPFileDialog::defaultNameFilterDisables() const {
return false;
}
void XDPFileDialog::setDirectory(const QUrl &directory) { void XDPFileDialog::setDirectory(const QUrl &directory) {
_directory = directory.path().toStdString(); _directory = directory.path().toStdString();
} }
@ -544,23 +534,6 @@ QList<QUrl> XDPFileDialog::selectedFiles() const {
return files; return files;
} }
void XDPFileDialog::setFilter() {
}
void XDPFileDialog::selectMimeTypeFilter(const QString &filter) {
}
QString XDPFileDialog::selectedMimeTypeFilter() const {
return QString::fromStdString(_selectedMimeTypeFilter);
}
void XDPFileDialog::selectNameFilter(const QString &filter) {
}
QString XDPFileDialog::selectedNameFilter() const {
return QString::fromStdString(_selectedNameFilter);
}
int XDPFileDialog::exec() { int XDPFileDialog::exec() {
setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_DeleteOnClose, false);

View file

@ -49,7 +49,6 @@ protected:
private: private:
void updateControlsGeometry(int newWidth); void updateControlsGeometry(int newWidth);
Ui::RpWidget *pushButton(base::unique_qptr<Ui::RpWidget> button); Ui::RpWidget *pushButton(base::unique_qptr<Ui::RpWidget> button);
void removeButton(not_null<Ui::RpWidget*> button);
const style::InfoTopBar &_st; const style::InfoTopBar &_st;
std::vector<base::unique_qptr<Ui::RpWidget>> _buttons; std::vector<base::unique_qptr<Ui::RpWidget>> _buttons;
@ -136,12 +135,6 @@ Ui::RpWidget *TopBar::pushButton(base::unique_qptr<Ui::RpWidget> button) {
return weak; return weak;
} }
void TopBar::removeButton(not_null<Ui::RpWidget*> button) {
_buttons.erase(
std::remove(_buttons.begin(), _buttons.end(), button),
_buttons.end());
}
int TopBar::resizeGetHeight(int newWidth) { int TopBar::resizeGetHeight(int newWidth) {
updateControlsGeometry(newWidth); updateControlsGeometry(newWidth);
return _st.height; return _st.height;

View file

@ -126,7 +126,6 @@ private:
void setInnerFocus(); void setInnerFocus();
void putNext(const object_ptr<TimePart> &field, QChar ch); void putNext(const object_ptr<TimePart> &field, QChar ch);
void erasePrevious(const object_ptr<TimePart> &field); void erasePrevious(const object_ptr<TimePart> &field);
void finishInnerAnimating();
void setErrorShown(bool error); void setErrorShown(bool error);
void setFocused(bool focused); void setFocused(bool focused);
void startBorderAnimation(); void startBorderAnimation();
@ -538,14 +537,6 @@ void TimeInput::setFocused(bool focused) {
} }
} }
void TimeInput::finishInnerAnimating() {
_hour->finishAnimating();
_minute->finishAnimating();
_a_borderOpacity.stop();
_a_borderShown.stop();
_a_error.stop();
}
void TimeInput::startBorderAnimation() { void TimeInput::startBorderAnimation() {
auto borderVisible = (_error || _focused); auto borderVisible = (_error || _focused);
if (_borderVisible != borderVisible) { if (_borderVisible != borderVisible) {

View file

@ -412,7 +412,7 @@ void EmptyUserpic::fillString(const QString &name) {
auto ch = name.constData(), end = ch + name.size(); auto ch = name.constData(), end = ch + name.size();
while (ch != end) { while (ch != end) {
auto emojiLength = 0; auto emojiLength = 0;
if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { if (Ui::Emoji::Find(ch, end, &emojiLength)) {
ch += emojiLength; ch += emojiLength;
} else if (ch->isHighSurrogate()) { } else if (ch->isHighSurrogate()) {
++ch; ++ch;

View file

@ -491,11 +491,9 @@ void MainWindow::initSize() {
} }
const auto primaryScreen = QGuiApplication::primaryScreen(); const auto primaryScreen = QGuiApplication::primaryScreen();
auto geometryScreen = primaryScreen;
const auto available = primaryScreen const auto available = primaryScreen
? primaryScreen->availableGeometry() ? primaryScreen->availableGeometry()
: QRect(0, 0, st::windowDefaultWidth, st::windowDefaultHeight); : QRect(0, 0, st::windowDefaultWidth, st::windowDefaultHeight);
bool maximized = false;
const auto initialWidth = Core::Settings::ThirdColumnByDefault() const auto initialWidth = Core::Settings::ThirdColumnByDefault()
? st::windowBigDefaultWidth ? st::windowBigDefaultWidth
: st::windowDefaultWidth; : st::windowDefaultWidth;
@ -561,13 +559,11 @@ void MainWindow::initSize() {
position.y + st::windowMinHeight <= screenGeometry.y() + screenGeometry.height()) { position.y + st::windowMinHeight <= screenGeometry.y() + screenGeometry.height()) {
DEBUG_LOG(("Window Pos: Resulting geometry is %1, %2, %3, %4").arg(position.x).arg(position.y).arg(position.w).arg(position.h)); DEBUG_LOG(("Window Pos: Resulting geometry is %1, %2, %3, %4").arg(position.x).arg(position.y).arg(position.w).arg(position.h));
geometry = QRect(position.x, position.y, position.w, position.h); geometry = QRect(position.x, position.y, position.w, position.h);
geometryScreen = screen;
} }
} }
break; break;
} }
} }
maximized = position.maximized;
} }
geometry += _padding; geometry += _padding;
DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height())); DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height()));

View file

@ -320,7 +320,7 @@ bool EditorBlock::selectSkip(int direction) {
if (newSelected < -1 || newSelected > maxSelected) { if (newSelected < -1 || newSelected > maxSelected) {
newSelected = maxSelected; newSelected = maxSelected;
} }
if (auto changed = (newSelected != _selected)) { if (newSelected != _selected) {
setSelected(newSelected); setSelected(newSelected);
scrollToSelected(); scrollToSelected();
return (newSelected >= 0); return (newSelected >= 0);

View file

@ -31,7 +31,7 @@ QString fillLetters(const QString &name) {
auto ch = name.constData(), end = ch + name.size(); auto ch = name.constData(), end = ch + name.size();
while (ch != end) { while (ch != end) {
auto emojiLength = 0; auto emojiLength = 0;
if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { if (Ui::Emoji::Find(ch, end, &emojiLength)) {
ch += emojiLength; ch += emojiLength;
} else if (ch->isHighSurrogate()) { } else if (ch->isHighSurrogate()) {
++ch; ++ch;
@ -243,10 +243,8 @@ void Generator::addAudioBubble(QVector<int> waveform, int waveactive, QString wa
auto skipBlock = computeSkipBlock(status, date); auto skipBlock = computeSkipBlock(status, date);
auto width = st::msgFileMinWidth; auto width = st::msgFileMinWidth;
auto tleft = 0, tright = 0;
const auto &st = st::msgFileLayout; const auto &st = st::msgFileLayout;
tleft = st.padding.left() + st.thumbSize + st.padding.right(); auto tleft = st.padding.left() + st.thumbSize + st.padding.right();
tright = st.padding.left();
accumulate_max(width, tleft + st::normalFont->width(wavestatus) + skipBlock.width() + st::msgPadding.right()); accumulate_max(width, tleft + st::normalFont->width(wavestatus) + skipBlock.width() + st::msgPadding.right());
accumulate_min(width, st::msgMaxWidth); accumulate_min(width, st::msgMaxWidth);

View file

@ -22,6 +22,7 @@ constexpr auto kMinimalSkip = 7;
constexpr auto kSoonSkip = 30; constexpr auto kSoonSkip = 30;
constexpr auto kNowSkip = 90; constexpr auto kNowSkip = 90;
#ifdef DESKTOP_APP_SPECIAL_TARGET
class Bar : public Ui::RpWidget { class Bar : public Ui::RpWidget {
public: public:
Bar(not_null<QWidget*> parent, QDate date); Bar(not_null<QWidget*> parent, QDate date);
@ -96,7 +97,6 @@ void Bar::paintEvent(QPaintEvent *e) {
_soon ? st::outdateSoonBg : st::outdatedBg); _soon ? st::outdateSoonBg : st::outdatedBg);
} }
#ifdef DESKTOP_APP_SPECIAL_TARGET
QString LastHiddenPath() { QString LastHiddenPath() {
return cWorkingDir() + qsl("tdata/outdated_hidden"); return cWorkingDir() + qsl("tdata/outdated_hidden");
} }