Renamed rpl::start_with_ with rpl::on_.
This commit is contained in:
@@ -176,7 +176,7 @@ Application::Application()
|
||||
_platformIntegration->init();
|
||||
|
||||
passcodeLockChanges(
|
||||
) | rpl::start_with_next([=](bool locked) {
|
||||
) | rpl::on_next([=](bool locked) {
|
||||
_shouldLockAt = 0;
|
||||
if (locked) {
|
||||
closeAdditionalWindows();
|
||||
@@ -184,18 +184,18 @@ Application::Application()
|
||||
}, _lifetime);
|
||||
|
||||
passcodeLockChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_notifications->updateAll();
|
||||
updateWindowTitles();
|
||||
}, _lifetime);
|
||||
|
||||
settings().windowTitleContentChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
updateWindowTitles();
|
||||
}, _lifetime);
|
||||
|
||||
_domain->activeSessionChanges(
|
||||
) | rpl::start_with_next([=](Main::Session *session) {
|
||||
) | rpl::on_next([=](Main::Session *session) {
|
||||
if (session && !UpdaterDisabled()) { // #TODO multi someSessionValue
|
||||
UpdateChecker().setMtproto(session);
|
||||
}
|
||||
@@ -305,12 +305,12 @@ void Application::run() {
|
||||
rpl::combine(
|
||||
_batterySaving->value(),
|
||||
settings().ignoreBatterySavingValue()
|
||||
) | rpl::start_with_next([=](bool saving, bool ignore) {
|
||||
) | rpl::on_next([=](bool saving, bool ignore) {
|
||||
PowerSaving::SetForceAll(saving && !ignore);
|
||||
}, _lifetime);
|
||||
|
||||
style::ShortAnimationPlaying(
|
||||
) | rpl::start_with_next([=](bool playing) {
|
||||
) | rpl::on_next([=](bool playing) {
|
||||
if (playing) {
|
||||
MTP::details::pause();
|
||||
} else {
|
||||
@@ -335,7 +335,7 @@ void Application::run() {
|
||||
_windowInSettings = _lastActivePrimaryWindow = _lastActiveWindow;
|
||||
|
||||
_domain->activeChanges(
|
||||
) | rpl::start_with_next([=](not_null<Main::Account*> account) {
|
||||
) | rpl::on_next([=](not_null<Main::Account*> account) {
|
||||
showAccount(account);
|
||||
}, _lifetime);
|
||||
|
||||
@@ -351,7 +351,7 @@ void Application::run() {
|
||||
? _domain->activeChanges()
|
||||
: rpl::never<not_null<Main::Account*>>();
|
||||
}) | rpl::flatten_latest(
|
||||
) | rpl::start_with_next([=](not_null<Main::Account*> account) {
|
||||
) | rpl::on_next([=](not_null<Main::Account*> account) {
|
||||
const auto ordered = _domain->orderedAccounts();
|
||||
const auto it = ranges::find(ordered, account);
|
||||
if (_lastActivePrimaryWindow && it != end(ordered)) {
|
||||
@@ -367,7 +367,7 @@ void Application::run() {
|
||||
QCoreApplication::instance()->installEventFilter(this);
|
||||
|
||||
appDeactivatedValue(
|
||||
) | rpl::start_with_next([=](bool deactivated) {
|
||||
) | rpl::on_next([=](bool deactivated) {
|
||||
if (deactivated) {
|
||||
handleAppDeactivated();
|
||||
} else {
|
||||
@@ -403,7 +403,7 @@ void Application::run() {
|
||||
}
|
||||
|
||||
_openInMediaViewRequests.events(
|
||||
) | rpl::start_with_next([=](Media::View::OpenRequest &&request) {
|
||||
) | rpl::on_next([=](Media::View::OpenRequest &&request) {
|
||||
if (_mediaView) {
|
||||
_mediaView->show(std::move(request));
|
||||
}
|
||||
@@ -509,7 +509,7 @@ void Application::startSystemDarkModeViewer() {
|
||||
rpl::merge(
|
||||
settings().systemDarkModeChanges() | rpl::to_empty,
|
||||
settings().systemDarkModeEnabledChanges() | rpl::to_empty
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
checkSystemDarkMode();
|
||||
}, _lifetime);
|
||||
}
|
||||
@@ -564,18 +564,18 @@ void Application::createTray() {
|
||||
using WindowRaw = not_null<Window::Controller*>;
|
||||
_tray->create();
|
||||
_tray->aboutToShowRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
enumerateWindows([&](WindowRaw w) { w->updateIsActive(); });
|
||||
_tray->updateMenuText();
|
||||
}, _lifetime);
|
||||
|
||||
_tray->showFromTrayRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
activate();
|
||||
}, _lifetime);
|
||||
|
||||
_tray->hideToTrayRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
enumerateWindows([&](WindowRaw w) {
|
||||
w->widget()->minimizeToTray();
|
||||
});
|
||||
@@ -813,7 +813,7 @@ void Application::badMtprotoConfigurationError() {
|
||||
_badProxyDisableBox = Ui::show(
|
||||
Ui::MakeInformBox(Lang::Hard::ProxyConfigError()));
|
||||
_badProxyDisableBox->boxClosing(
|
||||
) | rpl::start_with_next(
|
||||
) | rpl::on_next(
|
||||
disableCallback,
|
||||
_badProxyDisableBox->lifetime());
|
||||
}
|
||||
@@ -823,7 +823,7 @@ void Application::startLocalStorage() {
|
||||
Ui::GL::DetectLastCheckCrash();
|
||||
Local::start();
|
||||
_saveSettingsTimer.emplace([=] { saveSettings(); });
|
||||
settings().saveDelayedRequests() | rpl::start_with_next([=] {
|
||||
settings().saveDelayedRequests() | rpl::on_next([=] {
|
||||
saveSettingsDelayed();
|
||||
}, _lifetime);
|
||||
}
|
||||
@@ -837,7 +837,7 @@ void Application::startEmojiImageLoader() {
|
||||
});
|
||||
|
||||
settings().largeEmojiChanges(
|
||||
) | rpl::start_with_next([=](bool large) {
|
||||
) | rpl::on_next([=](bool large) {
|
||||
if (large) {
|
||||
_clearEmojiImageLoaderTimer.cancel();
|
||||
} else {
|
||||
@@ -847,7 +847,7 @@ void Application::startEmojiImageLoader() {
|
||||
}, _lifetime);
|
||||
|
||||
Ui::Emoji::Updated(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_emojiImageLoader.with([
|
||||
source = prepareEmojiSourceImages()
|
||||
](Stickers::EmojiImageLoader &loader) mutable {
|
||||
@@ -1485,7 +1485,7 @@ void Application::setLastActiveWindow(Window::Controller *window) {
|
||||
return;
|
||||
}
|
||||
window->floatPlayerDelegateValue(
|
||||
) | rpl::start_with_next([=](Media::Player::FloatDelegate *value) {
|
||||
) | rpl::on_next([=](Media::Player::FloatDelegate *value) {
|
||||
if (!value) {
|
||||
_floatPlayers = nullptr;
|
||||
} else if (_floatPlayers) {
|
||||
@@ -1812,12 +1812,12 @@ void Application::startShortcuts() {
|
||||
Shortcuts::Start();
|
||||
|
||||
_domain->activeSessionChanges(
|
||||
) | rpl::start_with_next([=](Main::Session *session) {
|
||||
) | rpl::on_next([=](Main::Session *session) {
|
||||
refreshApplicationIcon(session);
|
||||
}, _lifetime);
|
||||
|
||||
Shortcuts::Requests(
|
||||
) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
) | rpl::on_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
request->check(Command::Quit) && request->handle([] {
|
||||
Quit();
|
||||
|
||||
@@ -51,7 +51,7 @@ Changelogs::Changelogs(not_null<Main::Session*> session, int oldVersion)
|
||||
_session->data().chatsListChanges(
|
||||
) | rpl::filter([](Data::Folder *folder) {
|
||||
return !folder;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
requestCloudLogs();
|
||||
}, _chatsSubscription);
|
||||
}
|
||||
|
||||
@@ -362,21 +362,21 @@ LastCrashedWindow::LastCrashedWindow(
|
||||
Core::UpdateChecker checker;
|
||||
using Progress = Core::UpdateChecker::Progress;
|
||||
checker.checking(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Assert(_updaterData != nullptr);
|
||||
|
||||
setUpdatingState(UpdatingCheck);
|
||||
}, _lifetime);
|
||||
|
||||
checker.isLatest(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Assert(_updaterData != nullptr);
|
||||
|
||||
setUpdatingState(UpdatingLatest);
|
||||
}, _lifetime);
|
||||
|
||||
checker.progress(
|
||||
) | rpl::start_with_next([=](const Progress &result) {
|
||||
) | rpl::on_next([=](const Progress &result) {
|
||||
Assert(_updaterData != nullptr);
|
||||
|
||||
setUpdatingState(UpdatingDownload);
|
||||
@@ -384,14 +384,14 @@ LastCrashedWindow::LastCrashedWindow(
|
||||
}, _lifetime);
|
||||
|
||||
checker.failed(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Assert(_updaterData != nullptr);
|
||||
|
||||
setUpdatingState(UpdatingFail);
|
||||
}, _lifetime);
|
||||
|
||||
checker.ready(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Assert(_updaterData != nullptr);
|
||||
|
||||
setUpdatingState(UpdatingReady);
|
||||
@@ -880,7 +880,7 @@ void LastCrashedWindow::networkSettings() {
|
||||
proxy.user,
|
||||
proxy.password);
|
||||
box->saveRequests(
|
||||
) | rpl::start_with_next([=](MTP::ProxyData &&data) {
|
||||
) | rpl::on_next([=](MTP::ProxyData &&data) {
|
||||
Assert(data.host.isEmpty() || data.port != 0);
|
||||
_proxyChanges.fire(std::move(data));
|
||||
proxyUpdated();
|
||||
|
||||
@@ -322,7 +322,7 @@ void ShowPhonePrivacyBox(Window::SessionController *controller) {
|
||||
key
|
||||
) | rpl::take(
|
||||
1
|
||||
) | rpl::start_with_next([=](const Privacy::Rule &value) mutable {
|
||||
) | rpl::on_next([=](const Privacy::Rule &value) mutable {
|
||||
using namespace ::Settings;
|
||||
const auto show = shared->alive();
|
||||
if (lifetime) {
|
||||
@@ -1111,7 +1111,7 @@ bool ShowEditBirthdayPrivacy(
|
||||
Api::UserPrivacy::Key::Birthday
|
||||
) | rpl::take(
|
||||
1
|
||||
) | rpl::start_with_next([=](const Api::UserPrivacy::Rule &value) {
|
||||
) | rpl::on_next([=](const Api::UserPrivacy::Rule &value) {
|
||||
if (isFromBox) {
|
||||
using namespace ::Settings;
|
||||
class Controller final : public BirthdayPrivacyController {
|
||||
@@ -1162,7 +1162,7 @@ bool ShowEditPersonalChannel(
|
||||
};
|
||||
|
||||
rawController->chosen(
|
||||
) | rpl::start_with_next([=](not_null<ChannelData*> channel) {
|
||||
) | rpl::on_next([=](not_null<ChannelData*> channel) {
|
||||
save(channel);
|
||||
}, box->lifetime());
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ ResolvePhoneAction::ResolvePhoneAction(
|
||||
}
|
||||
|
||||
paintRequest(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Painter p(this);
|
||||
paint(p);
|
||||
}, lifetime());
|
||||
@@ -213,7 +213,7 @@ void ResolvePhoneAction::prepare() {
|
||||
? rpl::single(QString())
|
||||
: tr::lng_contacts_loading();
|
||||
}) | rpl::flatten_latest()
|
||||
) | rpl::start_with_next([=](
|
||||
) | rpl::on_next([=](
|
||||
QString text,
|
||||
QString name,
|
||||
QString no,
|
||||
|
||||
@@ -359,7 +359,7 @@ void Sandbox::singleInstanceChecked() {
|
||||
_lastCrashDump,
|
||||
[=] { launchApplication(); });
|
||||
window->proxyChanges(
|
||||
) | rpl::start_with_next([=](MTP::ProxyData &&proxy) {
|
||||
) | rpl::on_next([=](MTP::ProxyData &&proxy) {
|
||||
_sandboxProxy = std::move(proxy);
|
||||
refreshGlobalProxy();
|
||||
}, window->lifetime());
|
||||
|
||||
@@ -1134,19 +1134,19 @@ private:
|
||||
Updater::Updater()
|
||||
: _timer([=] { check(); })
|
||||
, _retryTimer([=] { handleTimeout(); }) {
|
||||
checking() | rpl::start_with_next([=] {
|
||||
checking() | rpl::on_next([=] {
|
||||
handleChecking();
|
||||
}, _lifetime);
|
||||
progress() | rpl::start_with_next([=] {
|
||||
progress() | rpl::on_next([=] {
|
||||
handleProgress();
|
||||
}, _lifetime);
|
||||
failed() | rpl::start_with_next([=] {
|
||||
failed() | rpl::on_next([=] {
|
||||
handleFailed();
|
||||
}, _lifetime);
|
||||
ready() | rpl::start_with_next([=] {
|
||||
ready() | rpl::on_next([=] {
|
||||
handleReady();
|
||||
}, _lifetime);
|
||||
isLatest() | rpl::start_with_next([=] {
|
||||
isLatest() | rpl::on_next([=] {
|
||||
handleLatest();
|
||||
}, _lifetime);
|
||||
}
|
||||
@@ -1299,11 +1299,11 @@ void Updater::startImplementation(
|
||||
}
|
||||
|
||||
checker->ready(
|
||||
) | rpl::start_with_next([=](std::shared_ptr<Loader> &&loader) {
|
||||
) | rpl::on_next([=](std::shared_ptr<Loader> &&loader) {
|
||||
checkerDone(which, std::move(loader));
|
||||
}, checker->lifetime());
|
||||
checker->failed(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
checkerFail(which);
|
||||
}, checker->lifetime());
|
||||
|
||||
@@ -1373,11 +1373,11 @@ bool Updater::tryLoaders() {
|
||||
loader->progress(
|
||||
) | rpl::start_to_stream(_progress, loader->lifetime());
|
||||
loader->ready(
|
||||
) | rpl::start_with_next([=](QString &&filepath) {
|
||||
) | rpl::on_next([=](QString &&filepath) {
|
||||
finalize(std::move(filepath));
|
||||
}, loader->lifetime());
|
||||
loader->failed(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_failed.fire({});
|
||||
}, loader->lifetime());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user