2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Wrapped raw SectionMemento with unique_ptr.

This commit is contained in:
23rd
2020-11-22 01:37:05 +03:00
committed by John Preston
parent de6b460754
commit c8643aa1ee
25 changed files with 67 additions and 63 deletions

View File

@@ -123,7 +123,7 @@ PollData *AbstractController::poll() const {
}
void AbstractController::showSection(
Window::SectionMemento &&memento,
std::unique_ptr<Window::SectionMemento> &&memento,
const Window::SectionShow &params) {
return parentController()->showSection(std::move(memento), params);
}
@@ -170,7 +170,7 @@ void Controller::setupMigrationViewer() {
const auto section = _section;
InvokeQueued(_widget, [=] {
window->showSection(
Memento(peer, section),
std::make_unique<Memento>(peer, section),
Window::SectionShow(
Window::SectionShow::Way::Backward,
anim::type::instant,
@@ -261,9 +261,9 @@ void Controller::saveSearchState(not_null<ContentMemento*> memento) {
}
void Controller::showSection(
Window::SectionMemento &&memento,
std::unique_ptr<Window::SectionMemento> &&memento,
const Window::SectionShow &params) {
if (!_widget->showInternal(&memento, params)) {
if (!_widget->showInternal(memento.get(), params)) {
AbstractController::showSection(std::move(memento), params);
}
}