Renamed rpl::start_with_ with rpl::on_.

This commit is contained in:
23rd
2025-12-10 20:51:57 +03:00
parent 29b714dd5f
commit eca8dfb0ec
623 changed files with 4524 additions and 4524 deletions

View File

@@ -163,12 +163,12 @@ ControllerObject::ControllerObject(
: _api(mtproto, weak.runner())
, _state(PasswordCheckState{}) {
_api.errors(
) | rpl::start_with_next([=](const MTP::Error &error) {
) | rpl::on_next([=](const MTP::Error &error) {
setState(ApiErrorState{ error });
}, _lifetime);
_api.ioErrors(
) | rpl::start_with_next([=](const Output::Result &result) {
) | rpl::on_next([=](const Output::Result &result) {
ioCatchError(result);
}, _lifetime);
@@ -193,12 +193,12 @@ ControllerObject::ControllerObject(
, _topicPeerId(peerId)
, _topicTitle(topicTitle) {
_api.errors(
) | rpl::start_with_next([=](const MTP::Error &error) {
) | rpl::on_next([=](const MTP::Error &error) {
setState(ApiErrorState{ error });
}, _lifetime);
_api.ioErrors(
) | rpl::start_with_next([=](const Output::Result &result) {
) | rpl::on_next([=](const Output::Result &result) {
ioCatchError(result);
}, _lifetime);

View File

@@ -62,14 +62,14 @@ void Manager::setupPanel(not_null<Main::Session*> session) {
session->account().sessionChanges(
) | rpl::filter([=](Main::Session *value) {
return (value != session);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
stop();
}, _panel->lifetime());
_viewChanges.fire(_panel.get());
_panel->stopRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
LOG(("Export Info: Stop requested."));
stop();
}, _controller->lifetime());

View File

@@ -68,7 +68,7 @@ void SuggestBox::prepare() {
tr::lng_export_suggest_text(tr::now),
st::boxLabel);
widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
const auto contentWidth = width
- st::boxPadding.left()
- st::boxPadding.right();
@@ -76,7 +76,7 @@ void SuggestBox::prepare() {
content->moveToLeft(st::boxPadding.left(), 0);
}, content->lifetime());
content->heightValue(
) | rpl::start_with_next([=](int height) {
) | rpl::on_next([=](int height) {
setDimensions(st::boxWidth, height + st::boxPadding.bottom());
}, content->lifetime());
}
@@ -146,7 +146,7 @@ PanelController::PanelController(
ResolveSettings(session, *_settings);
_process->state(
) | rpl::start_with_next([=](State &&state) {
) | rpl::on_next([=](State &&state) {
updateState(std::move(state));
}, _lifetime);
}
@@ -179,7 +179,7 @@ void PanelController::createPanel() {
: tr::lng_export_title)());
_panel->setInnerSize(st::exportPanelSize);
_panel->closeRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
LOG(("Export Info: Panel Hide By Close."));
_panel->hideGetDuration();
}, _panel->lifetime());
@@ -201,19 +201,19 @@ void PanelController::showSettings() {
});
settings->startClicks(
) | rpl::start_with_next([=]() {
) | rpl::on_next([=]() {
showProgress();
_process->startExport(*_settings, PrepareEnvironment(_session));
}, settings->lifetime());
settings->cancelClicks(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
LOG(("Export Info: Panel Hide By Cancel."));
_panel->hideGetDuration();
}, settings->lifetime());
settings->changes(
) | rpl::start_with_next([=](Settings &&settings) {
) | rpl::on_next([=](Settings &&settings) {
*_settings = std::move(settings);
}, settings->lifetime());
@@ -270,7 +270,7 @@ void PanelController::showCriticalError(const QString &text) {
st::exportErrorLabel),
style::margins(0, st::exportPanelSize.height() / 4, 0, 0));
container->widthValue(
) | rpl::start_with_next([label = container->entity()](int width) {
) | rpl::on_next([label = container->entity()](int width) {
label->resize(width, label->height());
}, container->lifetime());
@@ -289,7 +289,7 @@ void PanelController::showError(const QString &text) {
weak->setCloseByEscape(false);
weak->setCloseByOutsideClick(false);
weak->boxClosing(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
LOG(("Export Info: Panel Hide By Error: %1.").arg(text));
_panel->hideGetDuration();
}, weak->lifetime());
@@ -312,17 +312,17 @@ void PanelController::showProgress() {
) | rpl::then(progressState()));
progress->skipFileClicks(
) | rpl::start_with_next([=](uint64 randomId) {
) | rpl::on_next([=](uint64 randomId) {
_process->skipFile(randomId);
}, progress->lifetime());
progress->cancelClicks(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
stopWithConfirmation();
}, progress->lifetime());
progress->doneClicks(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (const auto finished = std::get_if<FinishedState>(&_state)) {
File::ShowInFolder(finished->path);
LOG(("Export Info: Panel Hide By Done: %1."

View File

@@ -244,7 +244,7 @@ ProgressWidget::ProgressWidget(
, _body(this)
, _fileShowSkipTimer([=] { _skipFile->show(anim::type::normal); }) {
widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
_body->resizeToWidth(width);
_body->moveToLeft(0, 0);
}, _body->lifetime());
@@ -270,7 +270,7 @@ ProgressWidget::ProgressWidget(
std::move(
content
) | rpl::start_with_next([=](Content &&content) {
) | rpl::on_next([=](Content &&content) {
updateState(std::move(content));
}, lifetime());
@@ -301,7 +301,7 @@ void ProgressWidget::setupBottomButton(not_null<Ui::RoundButton*> button) {
button->show();
sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
button->move(
(size.width() - button->width()) / 2,
(size.height() - st::exportCancelBottom - button->height()));

View File

@@ -149,7 +149,7 @@ void SettingsWidget::setupContent() {
setupPathAndFormat(content);
sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
scroll->resize(size.width(), size.height() - buttons->height());
wrap->resizeToWidth(size.width());
content->resizeToWidth(size.width());
@@ -232,7 +232,7 @@ void SettingsWidget::setupMediaOptions(
value() | rpl::map([](const Settings &data) {
return data.types;
}) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](Settings::Types types) {
) | rpl::on_next([=](Settings::Types types) {
mediaWrap->toggle((types & (Type::PersonalChats
| Type::BotChats
| Type::PrivateGroups
@@ -243,7 +243,7 @@ void SettingsWidget::setupMediaOptions(
}, mediaWrap->lifetime());
widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
mediaWrap->resizeToWidth(width);
}, mediaWrap->lifetime());
}
@@ -495,7 +495,7 @@ void SettingsWidget::addLimitsLabel(
const auto toSave = widget->lifetime().make_state<TimeId>(0);
std::move(
result.secondsValue
) | rpl::start_with_next([=](TimeId t) {
) | rpl::on_next([=](TimeId t) {
*toSave = t;
}, box->lifetime());
box->addButton(tr::lng_settings_save(), [=] {
@@ -668,14 +668,14 @@ not_null<Ui::RpWidget*> SettingsWidget::setupButtons(
value() | rpl::map([](const Settings &data) {
return (data.types != Types(0)) || data.onlySinglePeer();
}) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool canStart) {
) | rpl::on_next([=](bool canStart) {
refreshButtons(buttons, canStart);
topShadow->raise();
bottomShadow->raise();
}, buttons->lifetime());
sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
buttons->resizeToWidth(size.width());
buttons->moveToLeft(0, size.height() - buttons->height());
topShadow->resizeToWidth(size.width());
@@ -710,7 +710,7 @@ not_null<Ui::Checkbox*> SettingsWidget::addOption(
st::defaultBoxCheckbox),
st::exportSettingPadding);
checkbox->checkedChanges(
) | rpl::start_with_next([=](bool checked) {
) | rpl::on_next([=](bool checked) {
changeData([&](Settings &data) {
if (checked) {
data.types |= types;
@@ -753,7 +753,7 @@ void SettingsWidget::addChatOption(
st::exportSubSettingPadding));
onlyMy->entity()->checkedChanges(
) | rpl::start_with_next([=](bool checked) {
) | rpl::on_next([=](bool checked) {
changeData([&](Settings &data) {
if (checked) {
data.fullChats &= ~types;
@@ -816,7 +816,7 @@ void SettingsWidget::addMediaOption(
st::defaultBoxCheckbox),
st::exportSettingPadding);
checkbox->checkedChanges(
) | rpl::start_with_next([=](bool checked) {
) | rpl::on_next([=](bool checked) {
changeData([&](Settings &data) {
if (checked) {
data.media.types |= type;
@@ -850,7 +850,7 @@ void SettingsWidget::addSizeSlider(
st::exportFileSizeLabel);
value() | rpl::map([](const Settings &data) {
return data.media.sizeLimit;
}) | rpl::start_with_next([=](int64 sizeLimit) {
}) | rpl::on_next([=](int64 sizeLimit) {
const auto limit = sizeLimit / kMegabyte;
const auto size = QString::number(limit) + " MB";
const auto text = tr::lng_export_option_size_limit(
@@ -864,7 +864,7 @@ void SettingsWidget::addSizeSlider(
label->widthValue(),
slider->geometryValue(),
_2
) | rpl::start_with_next([=](QRect geometry) {
) | rpl::on_next([=](QRect geometry) {
label->moveToRight(
st::exportFileSizePadding.right(),
geometry.y() - label->height() - st::exportFileSizeLabelBottom);
@@ -893,7 +893,7 @@ void SettingsWidget::refreshButtons(
_startClicks = start->clicks() | rpl::to_empty;
container->sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
const auto right = st::defaultBox.buttonPadding.right();
const auto top = st::defaultBox.buttonPadding.top();
start->moveToRight(right, top);
@@ -911,7 +911,7 @@ void SettingsWidget::refreshButtons(
rpl::combine(
container->sizeValue(),
start ? start->widthValue() : rpl::single(0)
) | rpl::start_with_next([=](QSize size, int width) {
) | rpl::on_next([=](QSize size, int width) {
const auto right = st::defaultBox.buttonPadding.right()
+ (width ? width + st::defaultBox.buttonPadding.left() : 0);
const auto top = st::defaultBox.buttonPadding.top();