mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Replaced mapping to rpl::empty_value with rpl::to_empty.
This commit is contained in:
parent
e318a7d65f
commit
0696a2d5c0
29 changed files with 60 additions and 111 deletions
|
@ -246,22 +246,15 @@ auto AddButtonWithLoader(
|
||||||
) | rpl::then(
|
) | rpl::then(
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
// Events to toggle on.
|
// Events to toggle on.
|
||||||
dictionaryFromGlobalLoader->events(
|
dictionaryFromGlobalLoader->events() | rpl::map_to(true),
|
||||||
) | rpl::map([] {
|
|
||||||
return true;
|
|
||||||
}),
|
|
||||||
// Events to toggle off.
|
// Events to toggle off.
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
dictionaryRemoved->events(),
|
dictionaryRemoved->events(),
|
||||||
buttonState->value(
|
buttonState->value(
|
||||||
) | rpl::filter([](const DictState &state) {
|
) | rpl::filter([](const DictState &state) {
|
||||||
return state.is<Failed>();
|
return state.is<Failed>();
|
||||||
}) | rpl::map([] {
|
}) | rpl::to_empty
|
||||||
return rpl::empty_value();
|
) | rpl::map_to(false)
|
||||||
})
|
|
||||||
) | rpl::map([] {
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -275,10 +268,7 @@ auto AddButtonWithLoader(
|
||||||
buttonEnabled
|
buttonEnabled
|
||||||
) | rpl::then(
|
) | rpl::then(
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
dictionaryRemoved->events(
|
dictionaryRemoved->events() | rpl::map_to(false),
|
||||||
) | rpl::map([] {
|
|
||||||
return false;
|
|
||||||
}),
|
|
||||||
button->toggledValue()
|
button->toggledValue()
|
||||||
)
|
)
|
||||||
) | rpl::map([=](auto enabled) {
|
) | rpl::map([=](auto enabled) {
|
||||||
|
|
|
@ -206,7 +206,7 @@ void LocalStorageBox::Row::radialAnimationCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> LocalStorageBox::Row::clearRequests() const {
|
rpl::producer<> LocalStorageBox::Row::clearRequests() const {
|
||||||
return _clear->clicks() | rpl::map([] { return rpl::empty_value(); });
|
return _clear->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LocalStorageBox::Row::resizeGetHeight(int newWidth) {
|
int LocalStorageBox::Row::resizeGetHeight(int newWidth) {
|
||||||
|
|
|
@ -902,9 +902,9 @@ void PasscodeBox::recover() {
|
||||||
_cloudFields.notEmptyPassport));
|
_cloudFields.notEmptyPassport));
|
||||||
|
|
||||||
box->passwordCleared(
|
box->passwordCleared(
|
||||||
) | rpl::map([] {
|
) | rpl::map_to(
|
||||||
return QByteArray();
|
QByteArray()
|
||||||
}) | rpl::start_to_stream(_newPasswordSet, lifetime());
|
) | rpl::start_to_stream(_newPasswordSet, lifetime());
|
||||||
|
|
||||||
box->recoveryExpired(
|
box->recoveryExpired(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
|
|
|
@ -425,9 +425,7 @@ void SessionsBox::Inner::showData(const Full &data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> SessionsBox::Inner::terminateAll() const {
|
rpl::producer<> SessionsBox::Inner::terminateAll() const {
|
||||||
return _terminateAll->clicks() | rpl::map([] {
|
return _terminateAll->clicks() | rpl::to_empty;
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<uint64> SessionsBox::Inner::terminateOne() const {
|
rpl::producer<uint64> SessionsBox::Inner::terminateOne() const {
|
||||||
|
|
|
@ -335,16 +335,15 @@ rpl::producer<QString> ButtonManageDictsState(
|
||||||
? QString::number(filtered.size())
|
? QString::number(filtered.size())
|
||||||
: tr::lng_contacts_loading(tr::now);
|
: tr::lng_contacts_loading(tr::now);
|
||||||
};
|
};
|
||||||
const auto emptyValue = [] { return rpl::empty_value(); };
|
|
||||||
return rpl::single(
|
return rpl::single(
|
||||||
computeString()
|
computeString()
|
||||||
) | rpl::then(
|
) | rpl::then(
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
Spellchecker::SupportedScriptsChanged(),
|
Spellchecker::SupportedScriptsChanged(),
|
||||||
Core::App().settings().dictionariesEnabledChanges(
|
Core::App().settings().dictionariesEnabledChanges(
|
||||||
) | rpl::map(emptyValue),
|
) | rpl::to_empty,
|
||||||
Core::App().settings().spellcheckerEnabledChanges(
|
Core::App().settings().spellcheckerEnabledChanges(
|
||||||
) | rpl::map(emptyValue)
|
) | rpl::to_empty
|
||||||
) | rpl::map(computeString)
|
) | rpl::map(computeString)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,7 +335,7 @@ TabbedSelector::TabbedSelector(
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
(full()
|
(full()
|
||||||
? stickers()->scrollUpdated() | rpl::map([] { return 0; })
|
? stickers()->scrollUpdated() | rpl::map_to(0)
|
||||||
: rpl::never<int>() | rpl::type_erased()),
|
: rpl::never<int>() | rpl::type_erased()),
|
||||||
_scroll->scrollTopChanges()
|
_scroll->scrollTopChanges()
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
|
|
|
@ -156,7 +156,7 @@ rpl::producer<> UiIntegration::forcePopupMenuHideRequests() {
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
Core::App().passcodeLockChanges(),
|
Core::App().passcodeLockChanges(),
|
||||||
Core::App().termsLockChanges()
|
Core::App().termsLockChanges()
|
||||||
) | rpl::map([] { return rpl::empty_value(); });
|
) | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString UiIntegration::convertTagToMimeTag(const QString &tagId) {
|
QString UiIntegration::convertTagToMimeTag(const QString &tagId) {
|
||||||
|
|
|
@ -316,9 +316,7 @@ rpl::producer<> ScheduledMessages::updates(not_null<History*> history) {
|
||||||
return _updates.events(
|
return _updates.events(
|
||||||
) | rpl::filter([=](not_null<History*> value) {
|
) | rpl::filter([=](not_null<History*> value) {
|
||||||
return (value == history);
|
return (value == history);
|
||||||
}) | rpl::map([] {
|
}) | rpl::to_empty;
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Data::MessagesSlice ScheduledMessages::list(not_null<History*> history) {
|
Data::MessagesSlice ScheduledMessages::list(not_null<History*> history) {
|
||||||
|
|
|
@ -198,8 +198,7 @@ InnerWidget::InnerWidget(
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
session().settings().archiveCollapsedChanges(
|
session().settings().archiveCollapsedChanges() | rpl::to_empty,
|
||||||
) | rpl::map([] { return rpl::empty_value(); }),
|
|
||||||
session().data().chatsFilters().changed()
|
session().data().chatsFilters().changed()
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
refreshWithCollapsedRows();
|
refreshWithCollapsedRows();
|
||||||
|
|
|
@ -197,7 +197,7 @@ Widget::Widget(
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
fullSearchRefreshOn(session().settings().skipArchiveInSearchChanges(
|
fullSearchRefreshOn(session().settings().skipArchiveInSearchChanges(
|
||||||
) | rpl::map([] { return rpl::empty_value(); }));
|
) | rpl::to_empty);
|
||||||
|
|
||||||
connect(_inner, SIGNAL(draggingScrollDelta(int)), this, SLOT(onDraggingScrollDelta(int)));
|
connect(_inner, SIGNAL(draggingScrollDelta(int)), this, SLOT(onDraggingScrollDelta(int)));
|
||||||
connect(_inner, SIGNAL(mustScrollTo(int,int)), _scroll, SLOT(scrollToY(int,int)));
|
connect(_inner, SIGNAL(mustScrollTo(int,int)), _scroll, SLOT(scrollToY(int,int)));
|
||||||
|
@ -422,7 +422,7 @@ void Widget::setupSupportMode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fullSearchRefreshOn(session().settings().supportAllSearchResultsValue(
|
fullSearchRefreshOn(session().settings().supportAllSearchResultsValue(
|
||||||
) | rpl::map([] { return rpl::empty_value(); }));
|
) | rpl::to_empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::fullSearchRefreshOn(rpl::producer<> events) {
|
void Widget::fullSearchRefreshOn(rpl::producer<> events) {
|
||||||
|
|
|
@ -264,7 +264,7 @@ ProgressWidget::ProgressWidget(
|
||||||
|
|
||||||
rpl::producer<> ProgressWidget::cancelClicks() const {
|
rpl::producer<> ProgressWidget::cancelClicks() const {
|
||||||
return _cancel
|
return _cancel
|
||||||
? (_cancel->clicks() | rpl::map([] { return rpl::empty_value(); }))
|
? (_cancel->clicks() | rpl::to_empty)
|
||||||
: (rpl::never<>() | rpl::type_erased());
|
: (rpl::never<>() | rpl::type_erased());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,9 +326,8 @@ void ProgressWidget::showDone() {
|
||||||
_done->setFullWidth(desired);
|
_done->setFullWidth(desired);
|
||||||
}
|
}
|
||||||
_done->clicks(
|
_done->clicks(
|
||||||
) | rpl::map([] {
|
) | rpl::to_empty
|
||||||
return rpl::empty_value();
|
| rpl::start_to_stream(_doneClicks, _done->lifetime());
|
||||||
}) | rpl::start_to_stream(_doneClicks, _done->lifetime());
|
|
||||||
setupBottomButton(_done.get());
|
setupBottomButton(_done.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -742,10 +742,7 @@ void SettingsWidget::refreshButtons(
|
||||||
: nullptr;
|
: nullptr;
|
||||||
if (start) {
|
if (start) {
|
||||||
start->show();
|
start->show();
|
||||||
_startClicks = start->clicks(
|
_startClicks = start->clicks() | rpl::to_empty;
|
||||||
) | rpl::map([] {
|
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
|
|
||||||
container->sizeValue(
|
container->sizeValue(
|
||||||
) | rpl::start_with_next([=](QSize size) {
|
) | rpl::start_with_next([=](QSize size) {
|
||||||
|
@ -760,10 +757,7 @@ void SettingsWidget::refreshButtons(
|
||||||
tr::lng_cancel(),
|
tr::lng_cancel(),
|
||||||
st::defaultBoxButton);
|
st::defaultBoxButton);
|
||||||
cancel->show();
|
cancel->show();
|
||||||
_cancelClicks = cancel->clicks(
|
_cancelClicks = cancel->clicks() | rpl::to_empty;
|
||||||
) | rpl::map([] {
|
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
container->sizeValue(),
|
container->sizeValue(),
|
||||||
|
|
|
@ -178,18 +178,17 @@ object_ptr<Ui::FlatButton> SetupDiscussButton(
|
||||||
-> rpl::producer<std::tuple<int, bool>> {
|
-> rpl::producer<std::tuple<int, bool>> {
|
||||||
if (chat) {
|
if (chat) {
|
||||||
using UpdateFlag = Data::PeerUpdate::Flag;
|
using UpdateFlag = Data::PeerUpdate::Flag;
|
||||||
auto to_empty = rpl::map([=] { return rpl::empty_value(); });
|
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
chat->session().changes().historyUpdates(
|
chat->session().changes().historyUpdates(
|
||||||
Data::HistoryUpdate::Flag::UnreadView
|
Data::HistoryUpdate::Flag::UnreadView
|
||||||
) | rpl::filter([=](const Data::HistoryUpdate &update) {
|
) | rpl::filter([=](const Data::HistoryUpdate &update) {
|
||||||
return (update.history->peer == chat);
|
return (update.history->peer == chat);
|
||||||
}) | to_empty,
|
}) | rpl::to_empty,
|
||||||
|
|
||||||
chat->session().changes().peerFlagsValue(
|
chat->session().changes().peerFlagsValue(
|
||||||
chat,
|
chat,
|
||||||
UpdateFlag::Notifications | UpdateFlag::ChannelAmIn
|
UpdateFlag::Notifications | UpdateFlag::ChannelAmIn
|
||||||
) | to_empty
|
) | rpl::to_empty
|
||||||
) | rpl::map([=] {
|
) | rpl::map([=] {
|
||||||
const auto history = chat->amIn()
|
const auto history = chat->amIn()
|
||||||
? chat->owner().historyLoaded(chat)
|
? chat->owner().historyLoaded(chat)
|
||||||
|
|
|
@ -98,20 +98,16 @@ rpl::producer<> ComposeControls::cancelRequests() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ComposeControls::sendRequests() const {
|
rpl::producer<> ComposeControls::sendRequests() const {
|
||||||
auto toEmpty = rpl::map([] { return rpl::empty_value(); });
|
|
||||||
auto submits = base::qt_signal_producer(
|
auto submits = base::qt_signal_producer(
|
||||||
_field.get(),
|
_field.get(),
|
||||||
&Ui::InputField::submitted);
|
&Ui::InputField::submitted);
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
_send->clicks() | toEmpty,
|
_send->clicks() | rpl::to_empty,
|
||||||
std::move(submits) | toEmpty);
|
std::move(submits) | rpl::to_empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ComposeControls::attachRequests() const {
|
rpl::producer<> ComposeControls::attachRequests() const {
|
||||||
return _attachToggle->clicks(
|
return _attachToggle->clicks() | rpl::to_empty;
|
||||||
) | rpl::map([] {
|
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::setMimeDataHook(MimeDataHook hook) {
|
void ComposeControls::setMimeDataHook(MimeDataHook hook) {
|
||||||
|
|
|
@ -53,10 +53,6 @@ bool BarCurrentlyHidden(not_null<PeerData*> peer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto MapToEmpty() {
|
|
||||||
return rpl::map([] { return rpl::empty_value(); });
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
ContactStatus::Bar::Bar(QWidget *parent, const QString &name)
|
ContactStatus::Bar::Bar(QWidget *parent, const QString &name)
|
||||||
|
@ -94,23 +90,23 @@ void ContactStatus::Bar::showState(State state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ContactStatus::Bar::addClicks() const {
|
rpl::producer<> ContactStatus::Bar::addClicks() const {
|
||||||
return _add->clicks() | MapToEmpty();
|
return _add->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ContactStatus::Bar::blockClicks() const {
|
rpl::producer<> ContactStatus::Bar::blockClicks() const {
|
||||||
return _block->clicks() | MapToEmpty();
|
return _block->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ContactStatus::Bar::shareClicks() const {
|
rpl::producer<> ContactStatus::Bar::shareClicks() const {
|
||||||
return _share->clicks() | MapToEmpty();
|
return _share->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ContactStatus::Bar::reportClicks() const {
|
rpl::producer<> ContactStatus::Bar::reportClicks() const {
|
||||||
return _report->clicks() | MapToEmpty();
|
return _report->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ContactStatus::Bar::closeClicks() const {
|
rpl::producer<> ContactStatus::Bar::closeClicks() const {
|
||||||
return _close->clicks() | MapToEmpty();
|
return _close->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactStatus::Bar::resizeEvent(QResizeEvent *e) {
|
void ContactStatus::Bar::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
|
@ -107,9 +107,8 @@ void TopBar::enableBackButton() {
|
||||||
_back->setDuration(st::infoTopBarDuration);
|
_back->setDuration(st::infoTopBarDuration);
|
||||||
_back->toggle(!selectionMode(), anim::type::instant);
|
_back->toggle(!selectionMode(), anim::type::instant);
|
||||||
_back->entity()->clicks(
|
_back->entity()->clicks(
|
||||||
) | rpl::map([] {
|
) | rpl::to_empty
|
||||||
return rpl::empty_value();
|
| rpl::start_to_stream(_backClicks, _back->lifetime());
|
||||||
}) | rpl::start_to_stream(_backClicks, _back->lifetime());
|
|
||||||
registerToggleControlCallback(_back.data(), [=] {
|
registerToggleControlCallback(_back.data(), [=] {
|
||||||
return !selectionMode();
|
return !selectionMode();
|
||||||
});
|
});
|
||||||
|
@ -444,9 +443,8 @@ void TopBar::createSelectionControls() {
|
||||||
st::infoTopBarScale));
|
st::infoTopBarScale));
|
||||||
_cancelSelection->setDuration(st::infoTopBarDuration);
|
_cancelSelection->setDuration(st::infoTopBarDuration);
|
||||||
_cancelSelection->entity()->clicks(
|
_cancelSelection->entity()->clicks(
|
||||||
) | rpl::map([] {
|
) | rpl::to_empty
|
||||||
return rpl::empty_value();
|
| rpl::start_to_stream(
|
||||||
}) | rpl::start_to_stream(
|
|
||||||
_cancelSelectionClicks,
|
_cancelSelectionClicks,
|
||||||
_cancelSelection->lifetime());
|
_cancelSelection->lifetime());
|
||||||
_selectionText = wrap(Ui::CreateChild<Ui::FadeWrap<Ui::LabelWithNumbers>>(
|
_selectionText = wrap(Ui::CreateChild<Ui::FadeWrap<Ui::LabelWithNumbers>>(
|
||||||
|
|
|
@ -155,7 +155,7 @@ rpl::producer<bool> NotificationsEnabledValue(not_null<PeerData*> peer) {
|
||||||
peer->session().changes().peerFlagsValue(
|
peer->session().changes().peerFlagsValue(
|
||||||
peer,
|
peer,
|
||||||
UpdateFlag::Notifications
|
UpdateFlag::Notifications
|
||||||
) | rpl::map([] { return rpl::empty_value(); }),
|
) | rpl::to_empty,
|
||||||
peer->owner().defaultNotifyUpdates(peer)
|
peer->owner().defaultNotifyUpdates(peer)
|
||||||
) | rpl::map([=] {
|
) | rpl::map([=] {
|
||||||
return !peer->owner().notifyIsMuted(peer);
|
return !peer->owner().notifyIsMuted(peer);
|
||||||
|
|
|
@ -392,8 +392,7 @@ void Account::startMtp(std::unique_ptr<MTP::Config> config) {
|
||||||
const auto writingConfig = _lifetime.make_state<bool>(false);
|
const auto writingConfig = _lifetime.make_state<bool>(false);
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
_mtp->config().updates(),
|
_mtp->config().updates(),
|
||||||
_mtp->dcOptions().changed(
|
_mtp->dcOptions().changed() | rpl::to_empty
|
||||||
) | rpl::map([] { return rpl::empty_value(); })
|
|
||||||
) | rpl::filter([=] {
|
) | rpl::filter([=] {
|
||||||
return !*writingConfig;
|
return !*writingConfig;
|
||||||
}) | rpl::start_with_next([=] {
|
}) | rpl::start_with_next([=] {
|
||||||
|
|
|
@ -277,10 +277,8 @@ MainWidget::MainWidget(
|
||||||
updateDialogsWidthAnimated();
|
updateDialogsWidthAnimated();
|
||||||
});
|
});
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
session().settings().dialogsWidthRatioChanges()
|
session().settings().dialogsWidthRatioChanges() | rpl::to_empty,
|
||||||
| rpl::map([] { return rpl::empty_value(); }),
|
session().settings().thirdColumnWidthChanges() | rpl::to_empty
|
||||||
session().settings().thirdColumnWidthChanges()
|
|
||||||
| rpl::map([] { return rpl::empty_value(); })
|
|
||||||
) | rpl::start_with_next(
|
) | rpl::start_with_next(
|
||||||
[this] { updateControlsGeometry(); },
|
[this] { updateControlsGeometry(); },
|
||||||
lifetime());
|
lifetime());
|
||||||
|
@ -918,7 +916,7 @@ void MainWidget::createPlayer() {
|
||||||
this,
|
this,
|
||||||
object_ptr<Media::Player::Widget>(this, &session()));
|
object_ptr<Media::Player::Widget>(this, &session()));
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
_player->heightValue() | rpl::map([] { return true; }),
|
_player->heightValue() | rpl::map_to(true),
|
||||||
_player->shownValue()
|
_player->shownValue()
|
||||||
) | rpl::start_with_next(
|
) | rpl::start_with_next(
|
||||||
[this] { playerHeightUpdated(); },
|
[this] { playerHeightUpdated(); },
|
||||||
|
@ -1061,7 +1059,7 @@ void MainWidget::createExportTopBar(Export::View::Content &&data) {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
_exportTopBar->heightValue() | rpl::map([] { return true; }),
|
_exportTopBar->heightValue() | rpl::map_to(true),
|
||||||
_exportTopBar->shownValue()
|
_exportTopBar->shownValue()
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
exportTopBarHeightUpdated();
|
exportTopBarHeightUpdated();
|
||||||
|
|
|
@ -633,9 +633,7 @@ void PanelController::fillRows(
|
||||||
rpl::producer<> PanelController::refillRows() const {
|
rpl::producer<> PanelController::refillRows() const {
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
_submitFailed.events(),
|
_submitFailed.events(),
|
||||||
_form->valueSaveFinished() | rpl::map([] {
|
_form->valueSaveFinished() | rpl::to_empty);
|
||||||
return rpl::empty_value();
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelController::submitForm() {
|
void PanelController::submitForm() {
|
||||||
|
@ -703,7 +701,7 @@ void PanelController::setupPassword() {
|
||||||
box->newPasswordSet(
|
box->newPasswordSet(
|
||||||
) | rpl::filter([=](const QByteArray &password) {
|
) | rpl::filter([=](const QByteArray &password) {
|
||||||
return password.isEmpty();
|
return password.isEmpty();
|
||||||
}) | rpl::map([] { return rpl::empty_value(); })
|
}) | rpl::to_empty
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
_form->reloadPassword();
|
_form->reloadPassword();
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
|
|
@ -85,12 +85,10 @@ public:
|
||||||
void setError(bool error);
|
void setError(bool error);
|
||||||
|
|
||||||
rpl::producer<> deleteClicks() const {
|
rpl::producer<> deleteClicks() const {
|
||||||
return _delete->entity()->clicks(
|
return _delete->entity()->clicks() | rpl::to_empty;
|
||||||
) | rpl::map([] { return rpl::empty_value(); });
|
|
||||||
}
|
}
|
||||||
rpl::producer<> restoreClicks() const {
|
rpl::producer<> restoreClicks() const {
|
||||||
return _restore->entity()->clicks(
|
return _restore->entity()->clicks() | rpl::to_empty;
|
||||||
) | rpl::map([] { return rpl::empty_value(); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -196,7 +196,7 @@ void ColorsPalette::Button::update(
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ColorsPalette::Button::clicks() const {
|
rpl::producer<> ColorsPalette::Button::clicks() const {
|
||||||
return _widget.clicks() | rpl::map([] { return rpl::empty_value(); });
|
return _widget.clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ColorsPalette::Button::selected() const {
|
bool ColorsPalette::Button::selected() const {
|
||||||
|
|
|
@ -246,15 +246,15 @@ void FilterRowButton::updateButtonsVisibility() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> FilterRowButton::removeRequests() const {
|
rpl::producer<> FilterRowButton::removeRequests() const {
|
||||||
return _remove.clicks() | rpl::map([] { return rpl::empty_value(); });
|
return _remove.clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> FilterRowButton::restoreRequests() const {
|
rpl::producer<> FilterRowButton::restoreRequests() const {
|
||||||
return _restore.clicks() | rpl::map([] { return rpl::empty_value(); });
|
return _restore.clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> FilterRowButton::addRequests() const {
|
rpl::producer<> FilterRowButton::addRequests() const {
|
||||||
return _add.clicks() | rpl::map([] { return rpl::empty_value(); });
|
return _add.clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilterRowButton::paintEvent(QPaintEvent *e) {
|
void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
|
|
|
@ -556,7 +556,7 @@ object_ptr<Ui::BoxContent> EditCloudPasswordBox(not_null<Main::Session*> session
|
||||||
const auto box = result.data();
|
const auto box = result.data();
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
box->newPasswordSet() | rpl::map([] { return rpl::empty_value(); }),
|
box->newPasswordSet() | rpl::to_empty,
|
||||||
box->passwordReloadNeeded()
|
box->passwordReloadNeeded()
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
session->api().reloadPasswordState();
|
session->api().reloadPasswordState();
|
||||||
|
@ -583,8 +583,7 @@ void RemoveCloudPassword(not_null<::Main::Session*> session) {
|
||||||
const auto box = Ui::show(Box<PasscodeBox>(session, fields));
|
const auto box = Ui::show(Box<PasscodeBox>(session, fields));
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
box->newPasswordSet(
|
box->newPasswordSet() | rpl::to_empty,
|
||||||
) | rpl::map([] { return rpl::empty_value(); }),
|
|
||||||
box->passwordReloadNeeded()
|
box->passwordReloadNeeded()
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
session->api().reloadPasswordState();
|
session->api().reloadPasswordState();
|
||||||
|
|
|
@ -93,15 +93,13 @@ void SeparatePanel::updateTitlePosition() {
|
||||||
|
|
||||||
rpl::producer<> SeparatePanel::backRequests() const {
|
rpl::producer<> SeparatePanel::backRequests() const {
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
_back->entity()->clicks(
|
_back->entity()->clicks() | rpl::to_empty,
|
||||||
) | rpl::map([] { return rpl::empty_value(); }),
|
|
||||||
_synteticBackRequests.events());
|
_synteticBackRequests.events());
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> SeparatePanel::closeRequests() const {
|
rpl::producer<> SeparatePanel::closeRequests() const {
|
||||||
return rpl::merge(
|
return rpl::merge(
|
||||||
_close->clicks(
|
_close->clicks() | rpl::to_empty,
|
||||||
) | rpl::map([] { return rpl::empty_value(); }),
|
|
||||||
_userCloseRequests.events());
|
_userCloseRequests.events());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,7 @@ namespace {
|
||||||
[[nodiscard]] rpl::producer<Dialogs::UnreadState> MainListUnreadState(
|
[[nodiscard]] rpl::producer<Dialogs::UnreadState> MainListUnreadState(
|
||||||
not_null<Dialogs::MainList*> list) {
|
not_null<Dialogs::MainList*> list) {
|
||||||
return rpl::single(rpl::empty_value()) | rpl::then(
|
return rpl::single(rpl::empty_value()) | rpl::then(
|
||||||
list->unreadStateChanges(
|
list->unreadStateChanges() | rpl::to_empty
|
||||||
) | rpl::map([] { return rpl::empty_value(); })
|
|
||||||
) | rpl::map([=] {
|
) | rpl::map([=] {
|
||||||
return list->unreadState();
|
return list->unreadState();
|
||||||
});
|
});
|
||||||
|
|
|
@ -313,15 +313,11 @@ void TermsBox::prepare() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}) | rpl::map([] {
|
}) | rpl::to_empty | rpl::start_to_stream(_agreeClicks, lifetime());
|
||||||
return rpl::empty_value();
|
|
||||||
}) | rpl::start_to_stream(_agreeClicks, lifetime());
|
|
||||||
|
|
||||||
if (_cancel) {
|
if (_cancel) {
|
||||||
addButton(std::move(_cancel), [=] {})->clicks(
|
addButton(std::move(_cancel), [] {})->clicks(
|
||||||
) | rpl::map([] {
|
) | rpl::to_empty | rpl::start_to_stream(_cancelClicks, lifetime());
|
||||||
return rpl::empty_value();
|
|
||||||
}) | rpl::start_to_stream(_cancelClicks, lifetime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (age) {
|
if (age) {
|
||||||
|
|
|
@ -68,9 +68,7 @@ Bar::Bar(not_null<QWidget*> parent, QDate date)
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> Bar::hideClicks() const {
|
rpl::producer<> Bar::hideClicks() const {
|
||||||
return _close->clicks() | rpl::map([] {
|
return _close->clicks() | rpl::to_empty;
|
||||||
return rpl::empty_value();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Bar::resizeGetHeight(int newWidth) {
|
int Bar::resizeGetHeight(int newWidth) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6d6f692354b1b1d7b3808a01cc3337175ea5213d
|
Subproject commit b58d2804acda906119c53c1fa1a2593fa9895878
|
Loading…
Add table
Reference in a new issue