Slightly improved code style for long equality expressions.

This commit is contained in:
23rd 2024-04-11 18:56:11 +03:00 committed by John Preston
parent a37cbd7d05
commit 1c223e570a
48 changed files with 159 additions and 160 deletions

View file

@ -112,8 +112,8 @@ void ApplyLastList(
channel->mgInfo->lastAdmins.clear();
channel->mgInfo->lastRestricted.clear();
channel->mgInfo->lastParticipants.clear();
channel->mgInfo->lastParticipantsStatus =
MegagroupInfo::LastParticipantsUpToDate
channel->mgInfo->lastParticipantsStatus
= MegagroupInfo::LastParticipantsUpToDate
| MegagroupInfo::LastParticipantsOnceReceived;
auto botStatus = channel->mgInfo->botStatus;

View file

@ -58,10 +58,10 @@ void HandleWithdrawalButton(
state->loading = false;
auto fields = PasscodeBox::CloudFields::From(pass);
fields.customTitle =
tr::lng_channel_earn_balance_password_title();
fields.customDescription =
tr::lng_channel_earn_balance_password_description(tr::now);
fields.customTitle
= tr::lng_channel_earn_balance_password_title();
fields.customDescription
= tr::lng_channel_earn_balance_password_description(tr::now);
fields.customSubmitButton = tr::lng_passcode_submit();
fields.customCheckCallback = crl::guard(button, [=](
const Core::CloudPasswordResult &result) {

View file

@ -29,20 +29,20 @@ namespace {
using namespace rpl::details;
template <typename T>
constexpr auto WithId =
is_callable_plain_v<T, Fn<void()>, mtpRequestId>;
constexpr auto WithId
= is_callable_plain_v<T, Fn<void()>, mtpRequestId>;
template <typename T>
constexpr auto WithoutId =
is_callable_plain_v<T, Fn<void()>>;
constexpr auto WithoutId
= is_callable_plain_v<T, Fn<void()>>;
template <typename T>
constexpr auto WithoutCallback =
is_callable_plain_v<T>;
constexpr auto WithoutCallback
= is_callable_plain_v<T>;
template <typename T>
constexpr auto ErrorWithId =
is_callable_plain_v<T, QString, mtpRequestId>;
constexpr auto ErrorWithId
= is_callable_plain_v<T, QString, mtpRequestId>;
template <typename T>
constexpr auto ErrorWithoutId =
is_callable_plain_v<T, QString>;
constexpr auto ErrorWithoutId
= is_callable_plain_v<T, QString>;
template <typename DoneCallback, typename FailCallback>
mtpRequestId EditMessage(

View file

@ -307,8 +307,8 @@ void UserPrivacy::reload(Key key) {
}
void UserPrivacy::pushPrivacy(Key key, const TLRules &rules) {
const auto &saved = (_privacyValues[key] =
TLToRules(rules, _session->data()));
const auto &saved
= (_privacyValues[key] = TLToRules(rules, _session->data()));
const auto i = _privacyChanges.find(key);
if (i != end(_privacyChanges)) {
i->second.fire_copy(saved);

View file

@ -1544,8 +1544,8 @@ void ApiWrap::saveStickerSets(
writeRecent = true;
}
const auto isAttached =
(removedSetId == Data::Stickers::CloudRecentAttachedSetId);
const auto isAttached
= (removedSetId == Data::Stickers::CloudRecentAttachedSetId);
const auto flags = isAttached
? MTPmessages_ClearRecentStickers::Flag::f_attached
: MTPmessages_ClearRecentStickers::Flags(0);
@ -2494,8 +2494,8 @@ void ApiWrap::refreshFileReference(
}, [&](Data::FileOriginPeerPhoto data) {
fail();
}, [&](Data::FileOriginStickerSet data) {
const auto isRecentAttached =
(data.setId == Data::Stickers::CloudRecentAttachedSetId);
const auto isRecentAttached
= (data.setId == Data::Stickers::CloudRecentAttachedSetId);
if (data.setId == Data::Stickers::CloudRecentSetId
|| data.setId == Data::Stickers::RecentSetId
|| isRecentAttached) {

View file

@ -605,8 +605,8 @@ void GroupInfoBox::prepare() {
_navigation->session().api().selfDestruct().reload();
const auto top = addTopButton(st::infoTopBarMenu);
const auto menu =
top->lifetime().make_state<base::unique_qptr<Ui::PopupMenu>>();
const auto menu
= top->lifetime().make_state<base::unique_qptr<Ui::PopupMenu>>();
top->setClickedCallback([=] {
*menu = base::make_unique_q<Ui::PopupMenu>(
top,
@ -1306,8 +1306,8 @@ void SetupChannelBox::handleChange() {
&& (ch < 'a' || ch > 'z')
&& (ch < '0' || ch > '9')
&& ch != '_') {
const auto badSymbols =
tr::lng_create_channel_link_bad_symbols(tr::now);
const auto badSymbols
= tr::lng_create_channel_link_bad_symbols(tr::now);
if (_errorText != badSymbols) {
_errorText = badSymbols;
update();
@ -1317,8 +1317,8 @@ void SetupChannelBox::handleChange() {
}
}
if (name.size() < Ui::EditPeer::kMinUsernameLength) {
const auto tooShort =
tr::lng_create_channel_link_too_short(tr::now);
const auto tooShort
= tr::lng_create_channel_link_too_short(tr::now);
if (_errorText != tooShort) {
_errorText = tooShort;
update();

View file

@ -232,8 +232,8 @@ void DeleteMessagesBox::prepare() {
if (hasScheduledMessages()) {
} else if (auto revoke = revokeText(peer)) {
const auto &settings = Core::App().settings();
const auto revokeByDefault =
!settings.rememberedDeleteMessageOnlyForYou();
const auto revokeByDefault
= !settings.rememberedDeleteMessageOnlyForYou();
_revoke.create(
this,
revoke->checkbox,

View file

@ -983,8 +983,8 @@ void Controller::fillHistoryVisibilityButton() {
: HistoryVisibility::Visible;
_channelHasLocationOriginalValue = channel && channel->hasLocation();
const auto updateHistoryVisibility =
std::make_shared<rpl::event_stream<HistoryVisibility>>();
const auto updateHistoryVisibility
= std::make_shared<rpl::event_stream<HistoryVisibility>>();
const auto boxCallback = crl::guard(this, [=](HistoryVisibility checked) {
updateHistoryVisibility->fire(std::move(checked));
@ -1698,8 +1698,8 @@ void Controller::saveUsernamesOrder() {
channel->setUsernames(ranges::views::all(
newUsernames
) | ranges::views::transform([&](QString username) {
const auto editable =
(channel->editableUsername() == username);
const auto editable
= (channel->editableUsername() == username);
return Data::Username{
.username = std::move(username),
.active = true,

View file

@ -1240,8 +1240,8 @@ void DecorateListPromoBox(
box->setStyle(st::premiumPreviewDoubledLimitsBox);
box->widthValue(
) | rpl::start_with_next([=](int width) {
const auto &padding =
st::premiumPreviewDoubledLimitsBox.buttonPadding;
const auto &padding
= st::premiumPreviewDoubledLimitsBox.buttonPadding;
button->resizeToWidth(width
- padding.left()
- padding.right());

View file

@ -569,8 +569,8 @@ void StickerSetBox::updateButtons() {
if (!_inner->shortName().isEmpty()) {
const auto top = addTopButton(st::infoTopBarMenu);
const auto menu =
std::make_shared<base::unique_qptr<Ui::PopupMenu>>();
const auto menu
= std::make_shared<base::unique_qptr<Ui::PopupMenu>>();
top->setClickedCallback([=] {
*menu = base::make_unique_q<Ui::PopupMenu>(
top,
@ -613,8 +613,8 @@ void StickerSetBox::updateButtons() {
_show->showBox(std::move(box));
}
};
const auto menu =
std::make_shared<base::unique_qptr<Ui::PopupMenu>>();
const auto menu
= std::make_shared<base::unique_qptr<Ui::PopupMenu>>();
top->setClickedCallback([=] {
*menu = base::make_unique_q<Ui::PopupMenu>(
top,

View file

@ -945,8 +945,8 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
tgcalls::Descriptor descriptor = {
.version = versionString,
.config = tgcalls::Config{
.initializationTimeout =
serverConfig.callConnectTimeoutMs / 1000.,
.initializationTimeout
= serverConfig.callConnectTimeoutMs / 1000.,
.receiveTimeout = serverConfig.callPacketTimeoutMs / 1000.,
.dataSaving = tgcalls::DataSaving::Never,
.enableP2P = call.is_p2p_allowed(),

View file

@ -277,11 +277,11 @@ private:
MTP::Sender _api;
Type _type = Type::Outgoing;
rpl::variable<State> _state = State::Starting;
rpl::variable<RemoteAudioState> _remoteAudioState =
RemoteAudioState::Active;
rpl::variable<RemoteAudioState> _remoteAudioState
= RemoteAudioState::Active;
rpl::variable<Webrtc::VideoState> _remoteVideoState;
rpl::variable<RemoteBatteryState> _remoteBatteryState =
RemoteBatteryState::Normal;
rpl::variable<RemoteBatteryState> _remoteBatteryState
= RemoteBatteryState::Normal;
rpl::event_stream<Error> _errors;
FinishType _finishAfterRequestingCall = FinishType::None;
bool _answerAfterDhConfigReceived = false;

View file

@ -162,8 +162,8 @@ private:
object_ptr<Ui::FlatLabel> _status;
object_ptr<Ui::RpWidget> _fingerprint = { nullptr };
object_ptr<Ui::PaddingWrap<Ui::FlatLabel>> _remoteAudioMute = { nullptr };
object_ptr<Ui::PaddingWrap<Ui::FlatLabel>> _remoteLowBattery =
{ nullptr };
object_ptr<Ui::PaddingWrap<Ui::FlatLabel>> _remoteLowBattery
= { nullptr };
std::unique_ptr<Userpic> _userpic;
std::unique_ptr<VideoBubble> _outgoingVideoBubble;
QPixmap _bottomShadow;

View file

@ -25,8 +25,8 @@ const auto kSpeakerThreshold = std::vector<float>{
50.0f / kMaxVolumePercent,
150.0f / kMaxVolumePercent };
constexpr auto kVolumeStickedValues =
std::array<std::pair<float64, float64>, 7>{{
constexpr auto kVolumeStickedValues
= std::array<std::pair<float64, float64>, 7>{{
{ 25. / kMaxVolumePercent, 2. / kMaxVolumePercent },
{ 50. / kMaxVolumePercent, 2. / kMaxVolumePercent },
{ 75. / kMaxVolumePercent, 2. / kMaxVolumePercent },
@ -93,8 +93,8 @@ MenuVolumeItem::MenuVolumeItem(
const auto volume = _localMuted
? 0
: base::SafeRound(_slider->value() * kMaxVolumePercent);
const auto muteProgress =
_crossLineAnimation.value((!volume) ? 1. : 0.);
const auto muteProgress
= _crossLineAnimation.value((!volume) ? 1. : 0.);
const auto selected = isSelected();
p.fillRect(clip, selected ? st.itemBgOver : st.itemBg);
@ -174,8 +174,8 @@ MenuVolumeItem::MenuVolumeItem(
return;
}
if (_waitingForUpdateVolume) {
const auto localVolume =
base::SafeRound(_slider->value() * _maxVolume);
const auto localVolume
= base::SafeRound(_slider->value() * _maxVolume);
if ((localVolume != newVolume)
&& (_cloudVolume == newVolume)) {
_changeVolumeRequests.fire(int(localVolume));

View file

@ -437,8 +437,8 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
auto filterNotPassedByUsername = [this](UserData *user) -> bool {
if (PrimaryUsername(user).startsWith(_filter, Qt::CaseInsensitive)) {
const auto exactUsername =
(PrimaryUsername(user).size() == _filter.size());
const auto exactUsername
= (PrimaryUsername(user).size() == _filter.size());
return exactUsername;
}
return true;
@ -446,8 +446,9 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
auto filterNotPassedByName = [&](UserData *user) -> bool {
for (const auto &nameWord : user->nameWords()) {
if (nameWord.startsWith(_filter, Qt::CaseInsensitive)) {
const auto exactUsername =
(PrimaryUsername(user).compare(_filter, Qt::CaseInsensitive) == 0);
const auto exactUsername = PrimaryUsername(user).compare(
_filter,
Qt::CaseInsensitive) == 0;
return exactUsername;
}
}

View file

@ -933,8 +933,8 @@ void Application::handleAppDeactivated() {
}
rpl::producer<bool> Application::appDeactivatedValue() const {
const auto &app =
static_cast<QGuiApplication*>(QCoreApplication::instance());
const auto &app
= static_cast<QGuiApplication*>(QCoreApplication::instance());
return rpl::single(
app->applicationState()
) | rpl::then(

View file

@ -313,8 +313,8 @@ CloudPasswordState ParseCloudPasswordState(
ParseCloudPasswordAlgo(data.vnew_algo()));
result.mtp.newSecureSecret = ValidateNewSecureSecretAlgo(
ParseSecureSecretAlgo(data.vnew_secure_algo()));
result.unconfirmedPattern =
qs(data.vemail_unconfirmed_pattern().value_or_empty());
result.unconfirmedPattern = qs(
data.vemail_unconfirmed_pattern().value_or_empty());
result.pendingResetDate = data.vpending_reset_date().value_or_empty();
result.outdatedClient = [&] {

View file

@ -984,8 +984,8 @@ private:
#else // Q_OS_MAC
bool _hardwareAcceleratedVideo = false;
#endif // Q_OS_MAC
HistoryView::DoubleClickQuickAction _chatQuickAction =
HistoryView::DoubleClickQuickAction();
HistoryView::DoubleClickQuickAction _chatQuickAction
= HistoryView::DoubleClickQuickAction();
bool _translateButtonEnabled = false;
rpl::variable<bool> _translateChatEnabled = true;
rpl::variable<int> _translateToRaw = 0;

View file

@ -121,8 +121,8 @@ bool PollData::applyResults(const MTPPollResults &results) {
return results.match([&](const MTPDpollResults &results) {
_lastResultsUpdate = crl::now();
const auto newTotalVoters =
results.vtotal_voters().value_or(totalVoters);
const auto newTotalVoters
= results.vtotal_voters().value_or(totalVoters);
auto changed = (newTotalVoters != totalVoters);
if (const auto list = results.vresults()) {
for (const auto &result : list->v) {

View file

@ -37,8 +37,8 @@ struct StatisticalChart {
QString idString;
QString name;
Statistic::ChartValue maxValue = 0;
Statistic::ChartValue minValue =
std::numeric_limits<Statistic::ChartValue>::max();
Statistic::ChartValue minValue
= std::numeric_limits<Statistic::ChartValue>::max();
QString colorKey;
QColor color;
QColor colorDark;
@ -57,8 +57,8 @@ struct StatisticalChart {
} defaultZoomXIndex;
Statistic::ChartValue maxValue = 0;
Statistic::ChartValue minValue =
std::numeric_limits<Statistic::ChartValue>::max();
Statistic::ChartValue minValue
= std::numeric_limits<Statistic::ChartValue>::max();
float64 oneDayPercentage = 0.;

View file

@ -770,8 +770,8 @@ void Widget::updateScrollUpPosition() {
_scrollToTop->moveToRight(
st::historyToDownPosition.x(),
_scroll->height() - top);
const auto shouldBeHidden =
!_scrollToTopIsShown && !_scrollToTopShown.animating();
const auto shouldBeHidden
= !_scrollToTopIsShown && !_scrollToTopShown.animating();
if (shouldBeHidden != _scrollToTop->isHidden()) {
_scrollToTop->setVisible(!shouldBeHidden);
}

View file

@ -48,8 +48,8 @@ PhotoEditorContent::PhotoEditorContent(
return;
}
const auto imageSizeF = [&] {
const auto rotatedSize =
FlipSizeByRotation(size, mods.angle);
const auto rotatedSize
= FlipSizeByRotation(size, mods.angle);
const auto m = _crop->cropMargins();
const auto sizeForCrop = rotatedSize
- QSize(m.left() + m.right(), m.top() + m.bottom());

View file

@ -541,8 +541,8 @@ void ApiWrap::requestDialogsCount() {
Expects(_startProcess != nullptr);
if (_settings->onlySinglePeer()) {
_startProcess->info.dialogsCount =
(_settings->singlePeer.type() == mtpc_inputPeerChannel
_startProcess->info.dialogsCount
= (_settings->singlePeer.type() == mtpc_inputPeerChannel
? 1
: _splits.size());
sendNextStartRequest();

View file

@ -738,8 +738,8 @@ void GenerateItems(
using LogPromote = MTPDchannelAdminLogEventActionParticipantToggleAdmin;
using LogSticker = MTPDchannelAdminLogEventActionChangeStickerSet;
using LogEmoji = MTPDchannelAdminLogEventActionChangeEmojiStickerSet;
using LogPreHistory =
MTPDchannelAdminLogEventActionTogglePreHistoryHidden;
using LogPreHistory
= MTPDchannelAdminLogEventActionTogglePreHistoryHidden;
using LogPermissions = MTPDchannelAdminLogEventActionDefaultBannedRights;
using LogPoll = MTPDchannelAdminLogEventActionStopPoll;
using LogDiscussion = MTPDchannelAdminLogEventActionChangeLinkedChat;
@ -749,19 +749,19 @@ void GenerateItems(
using LogDiscardCall = MTPDchannelAdminLogEventActionDiscardGroupCall;
using LogMute = MTPDchannelAdminLogEventActionParticipantMute;
using LogUnmute = MTPDchannelAdminLogEventActionParticipantUnmute;
using LogCallSetting =
MTPDchannelAdminLogEventActionToggleGroupCallSetting;
using LogJoinByInvite =
MTPDchannelAdminLogEventActionParticipantJoinByInvite;
using LogInviteDelete =
MTPDchannelAdminLogEventActionExportedInviteDelete;
using LogInviteRevoke =
MTPDchannelAdminLogEventActionExportedInviteRevoke;
using LogCallSetting
= MTPDchannelAdminLogEventActionToggleGroupCallSetting;
using LogJoinByInvite
= MTPDchannelAdminLogEventActionParticipantJoinByInvite;
using LogInviteDelete
= MTPDchannelAdminLogEventActionExportedInviteDelete;
using LogInviteRevoke
= MTPDchannelAdminLogEventActionExportedInviteRevoke;
using LogInviteEdit = MTPDchannelAdminLogEventActionExportedInviteEdit;
using LogVolume = MTPDchannelAdminLogEventActionParticipantVolume;
using LogTTL = MTPDchannelAdminLogEventActionChangeHistoryTTL;
using LogJoinByRequest =
MTPDchannelAdminLogEventActionParticipantJoinByRequest;
using LogJoinByRequest
= MTPDchannelAdminLogEventActionParticipantJoinByRequest;
using LogNoForwards = MTPDchannelAdminLogEventActionToggleNoForwards;
using LogSendMessage = MTPDchannelAdminLogEventActionSendMessage;
using LogChangeAvailableReactions = MTPDchannelAdminLogEventActionChangeAvailableReactions;

View file

@ -52,8 +52,8 @@ DragArea::Areas DragArea::SetupDragAreaToContainer(
auto &lifetime = container->lifetime();
container->setAcceptDrops(true);
const auto attachDragDocument =
Ui::CreateChild<DragArea>(container.get());
const auto attachDragDocument
= Ui::CreateChild<DragArea>(container.get());
const auto attachDragPhoto = Ui::CreateChild<DragArea>(container.get());
attachDragDocument->hide();
@ -62,8 +62,8 @@ DragArea::Areas DragArea::SetupDragAreaToContainer(
attachDragDocument->raise();
attachDragPhoto->raise();
const auto attachDragState =
lifetime.make_state<DragState>(DragState::None);
const auto attachDragState
= lifetime.make_state<DragState>(DragState::None);
const auto width = [=] {
return container->width();

View file

@ -23,8 +23,8 @@ public:
DragArea *photo;
};
using CallbackComputeState =
Fn<Storage::MimeDataState(const QMimeData *data)>;
using CallbackComputeState
= Fn<Storage::MimeDataState(const QMimeData *data)>;
static Areas SetupDragAreaToContainer(
not_null<Ui::RpWidget*> container,

View file

@ -372,8 +372,8 @@ TTLButton::TTLButton(
return (r.left() + r.width() > parentWidget()->width());
}) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool toHide) {
const auto isFirstTooltip =
!Core::App().settings().ttlVoiceClickTooltipHidden();
const auto isFirstTooltip
= !Core::App().settings().ttlVoiceClickTooltipHidden();
if (isFirstTooltip || (!isFirstTooltip && toHide)) {
_tooltip->toggleAnimated(!toHide);
}

View file

@ -3898,8 +3898,8 @@ bool ListWidget::lastMessageEditRequestNotify() const {
if (it == end(list)) {
return false;
} else {
const auto item =
session().data().groups().findItemToEdit((*it)->data()).get();
const auto item
= session().data().groups().findItemToEdit((*it)->data()).get();
editMessageRequestNotify(item->fullId());
return true;
}

View file

@ -1849,8 +1849,8 @@ void Message::clickHandlerPressedChanged(
if (pressed) {
if (!_rightAction->second->ripple) {
// Create a ripple.
_rightAction->second->ripple =
std::make_unique<Ui::RippleAnimation>(
_rightAction->second->ripple
= std::make_unique<Ui::RippleAnimation>(
st::defaultRippleAnimation,
Ui::RippleAnimation::RoundRectMask(
Size(rightSize->width()),

View file

@ -150,8 +150,8 @@ bool SendActionPainter::paint(
const auto extraAnimationWidth = _animationLeft
? animationWidth * 2
: 0;
const auto left =
(availableWidth < _animationLeft + extraAnimationWidth)
const auto left
= (availableWidth < _animationLeft + extraAnimationWidth)
? 0
: _animationLeft;
_sendActionAnimation.paint(

View file

@ -496,8 +496,8 @@ QSize WebPage::countOptimalSize() {
minHeight = resizeGetHeight(maxWidth);
}
if (_sponsoredData && _sponsoredData->canReport) {
_sponsoredData->widthBeforeHint =
st::webPageTitleStyle.font->width(siteName);
_sponsoredData->widthBeforeHint
= st::webPageTitleStyle.font->width(siteName);
const auto &font = st::webPageSponsoredHintFont;
_sponsoredData->hintSize = QSize(
font->width(tr::lng_sponsored_message_revenue_button(tr::now))

View file

@ -683,13 +683,13 @@ void TopBar::createSelectionControls() {
_selectionActionRequests,
_cancelSelection->lifetime());
_delete->entity()->setVisible(_canDelete);
const auto archive =
_toggleStoryPin = wrap(Ui::CreateChild<Ui::FadeWrap<Ui::IconButton>>(
this,
object_ptr<Ui::IconButton>(
const auto archive = _toggleStoryPin = wrap(
Ui::CreateChild<Ui::FadeWrap<Ui::IconButton>>(
this,
_storiesArchive ? _st.storiesSave : _st.storiesArchive),
st::infoTopBarScale));
object_ptr<Ui::IconButton>(
this,
_storiesArchive ? _st.storiesSave : _st.storiesArchive),
st::infoTopBarScale));
registerToggleControlCallback(
_toggleStoryPin.data(),
[this] { return selectionMode() && _canToggleStoryPin; });

View file

@ -814,8 +814,8 @@ void ListWidget::paintEvent(QPaintEvent *e) {
}
if (_dateBadge->goodType && clip.intersects(_dateBadge->rect)) {
const auto scrollDateOpacity =
_dateBadge->opacity.value(_dateBadge->shown ? 1. : 0.);
const auto scrollDateOpacity
= _dateBadge->opacity.value(_dateBadge->shown ? 1. : 0.);
if (scrollDateOpacity > 0.) {
p.setOpacity(scrollDateOpacity);
if (_dateBadge->corners.p[0].isNull()) {

View file

@ -77,8 +77,8 @@ base::options::toggle AutoScrollInactiveChat({
} // namespace
const char kOptionAutoScrollInactiveChat[] =
"auto-scroll-inactive-chat";
const char kOptionAutoScrollInactiveChat[]
= "auto-scroll-inactive-chat";
MainWindow::MainWindow(not_null<Window::Controller*> controller)
: Platform::MainWindow(controller) {

View file

@ -35,8 +35,8 @@ constexpr auto kSpeedDebounceTimeout = crl::time(1000);
return base::SafeRound(speed * 10) / 10.;
}
constexpr auto kSpeedStickedValues =
std::array<std::pair<float64, float64>, 7>{{
constexpr auto kSpeedStickedValues
= std::array<std::pair<float64, float64>, 7>{{
{ 0.8, 0.05 },
{ 1.0, 0.05 },
{ 1.2, 0.05 },

View file

@ -44,8 +44,8 @@ bool SystemMediaControlsManager::Supported() {
SystemMediaControlsManager::SystemMediaControlsManager()
: _controls(std::make_unique<base::Platform::SystemMediaControls>()) {
using PlaybackStatus =
base::Platform::SystemMediaControls::PlaybackStatus;
using PlaybackStatus
= base::Platform::SystemMediaControls::PlaybackStatus;
using Command = base::Platform::SystemMediaControls::Command;
_controls->setApplicationName(AppName.utf16());

View file

@ -2686,8 +2686,8 @@ bool FormController::applyPassword(const MTPDaccount_password &result) {
settings.notEmptyPassport = result.is_has_secure_values();
settings.request = Core::ParseCloudPasswordCheckRequest(result);
settings.unknownAlgo = result.vcurrent_algo() && !settings.request;
settings.unconfirmedPattern =
qs(result.vemail_unconfirmed_pattern().value_or_empty());
settings.unconfirmedPattern = qs(
result.vemail_unconfirmed_pattern().value_or_empty());
settings.newAlgo = Core::ValidateNewCloudPasswordAlgo(
Core::ParseCloudPasswordAlgo(result.vnew_algo()));
settings.newSecureAlgo = Core::ValidateNewSecureSecretAlgo(

View file

@ -26,8 +26,8 @@ struct EditContactScheme;
enum class ReadScanError;
using preferredLangCallback =
Fn<rpl::producer<EditDocumentCountry>(const QString &)>;
using preferredLangCallback
= Fn<rpl::producer<EditDocumentCountry>(const QString &)>;
EditDocumentScheme GetDocumentScheme(
Scope::Type type,
std::optional<Value::Type> scansType,

View file

@ -315,19 +315,19 @@ bool NotificationData::init(
_actions.push_back("inline-reply");
_actions.push_back(tr::lng_notification_reply(tr::now).toStdString());
_notificationRepliedSignalId =
_interface.signal_notification_replied().connect([=](
XdgNotifications::Notifications,
uint id,
std::string text) {
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
if (id == _notificationId) {
_manager->notificationReplied(
_id,
{ QString::fromStdString(text), {} });
}
_notificationRepliedSignalId
= _interface.signal_notification_replied().connect([=](
XdgNotifications::Notifications,
uint id,
std::string text) {
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
if (id == _notificationId) {
_manager->notificationReplied(
_id,
{ QString::fromStdString(text), {} });
}
});
});
});
}
_actionInvokedSignalId = _interface.signal_action_invoked().connect([=](

View file

@ -551,13 +551,11 @@ NSRect PeerRectByIndex(int index) {
const auto processOnline = [=](const auto &pin) {
// TODO: this should be replaced
// with the global application timer for online statuses.
const auto onlineChanges =
peerChangedLifetime->make_state<rpl::event_stream<PeerData*>>();
const auto onlineChanges
= peerChangedLifetime->make_state<rpl::event_stream<PeerData*>>();
const auto peer = pin->peer;
const auto onlineTimer =
peerChangedLifetime->make_state<base::Timer>([=] {
onlineChanges->fire_copy({ peer });
});
const auto onlineTimer = peerChangedLifetime->make_state<base::Timer>(
[=] { onlineChanges->fire_copy({ peer }); });
const auto callTimer = [=](const auto &pin) {
onlineTimer->cancel();

View file

@ -135,8 +135,8 @@ const auto kAudioItemIdentifier = @"touchbarAudio";
if (isEqual(kMainItemIdentifier)) {
auto *item = [[GroupTouchBarItem alloc] initWithIdentifier:itemId];
item.groupTouchBar =
[[[TouchBarMain alloc]
item.groupTouchBar
= [[[TouchBarMain alloc]
init:_controller
touchBarSwitches:_touchBarSwitches.events()] autorelease];
rpl::combine(

View file

@ -605,8 +605,8 @@ QPointer<Ui::RpWidget> Business::createPinnedToBottom(
});
{
const auto callback = [=](int value) {
const auto options =
_controller->session().api().premium().subscriptionOptions();
auto &api = _controller->session().api();
const auto options = api.premium().subscriptionOptions();
if (options.empty()) {
return;
}

View file

@ -1211,8 +1211,8 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
#endif
{
const auto callback = [=](int value) {
const auto options =
_controller->session().api().premium().subscriptionOptions();
auto &api = _controller->session().api();
const auto options = api.premium().subscriptionOptions();
if (options.empty()) {
return;
}

View file

@ -1991,8 +1991,8 @@ void Account::readStickerSets(
if (datesCount != scnt) {
return failed();
}
const auto fillDates =
((set->id == Data::Stickers::CloudRecentSetId)
const auto fillDates
= ((set->id == Data::Stickers::CloudRecentSetId)
|| (set->id == Data::Stickers::CloudRecentAttachedSetId))
&& (set->stickers.size() == datesCount);
if (fillDates) {

View file

@ -146,8 +146,8 @@ ChooseDateTimeBoxDescriptor ChooseDateTimeBox(
width);
}, content->lifetime());
const auto calendar =
content->lifetime().make_state<QPointer<CalendarBox>>();
const auto calendar
= content->lifetime().make_state<QPointer<CalendarBox>>();
const auto calendarStyle = args.style.calendarStyle;
state->day->focusedChanges(
) | rpl::start_with_next([=](bool focused) {

View file

@ -414,8 +414,8 @@ void BlobsWidget::init(int diameter) {
}
// Main circle.
const auto circleProgress =
Clamp(_switchConnectingProgress - kBlobPartAnimation)
const auto circleProgress
= Clamp(_switchConnectingProgress - kBlobPartAnimation)
/ kFillCirclePartAnimation;
const auto skipColoredCircle = (circleProgress == 1.);
@ -744,8 +744,8 @@ void CallMuteButton::init() {
}, lifetime());
// State type.
const auto previousType =
lifetime().make_state<CallMuteButtonType>(_state.current().type);
const auto previousType
= lifetime().make_state<CallMuteButtonType>(_state.current().type);
setHandleMouseState(HandleMouseState::Disabled);
refreshGradients();

View file

@ -143,8 +143,8 @@ void ShareBotGame(
} // namespace
const char kOptionViewProfileInChatsListContextMenu[] =
"view-profile-in-chats-list-context-menu";
const char kOptionViewProfileInChatsListContextMenu[]
= "view-profile-in-chats-list-context-menu";
namespace {

View file

@ -2015,10 +2015,10 @@ void SessionController::resizeForThirdSection() {
auto &settings = Core::App().settings();
auto layout = computeColumnLayout();
auto tabbedSelectorSectionEnabled =
settings.tabbedSelectorSectionEnabled();
auto thirdSectionInfoEnabled =
settings.thirdSectionInfoEnabled();
auto tabbedSelectorSectionEnabled
= settings.tabbedSelectorSectionEnabled();
auto thirdSectionInfoEnabled
= settings.thirdSectionInfoEnabled();
settings.setTabbedSelectorSectionEnabled(false);
settings.setThirdSectionInfoEnabled(false);