mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use shared_ptr<Memento> for sections.
This commit is contained in:
@@ -650,7 +650,7 @@ void Manager::openNotificationMessage(
|
||||
Ui::showPeerHistory(history, messageId);
|
||||
//} else if (messageFeed) { // #feed
|
||||
// App::wnd()->sessionController()->showSection(
|
||||
// std::make_unique<HistoryFeed::Memento>(messageFeed));
|
||||
// std::make_shared<HistoryFeed::Memento>(messageFeed));
|
||||
} else {
|
||||
Ui::showPeerHistory(history, ShowAtUnreadMsgId);
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ void SectionWidget::showAnimated(
|
||||
show();
|
||||
}
|
||||
|
||||
std::unique_ptr<SectionMemento> SectionWidget::createMemento() {
|
||||
std::shared_ptr<SectionMemento> SectionWidget::createMemento() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
// Create a memento of that section to store it in the history stack.
|
||||
// This method may modify the section ("take" heavy items).
|
||||
virtual std::unique_ptr<SectionMemento> createMemento();
|
||||
virtual std::shared_ptr<SectionMemento> createMemento();
|
||||
|
||||
void setInnerFocus() {
|
||||
doSetInnerFocus();
|
||||
|
@@ -714,7 +714,7 @@ void Filler::addTogglesForArchive() {
|
||||
// const auto controller = _controller;
|
||||
// const auto feed = _feed;
|
||||
// _addAction(tr::lng_context_view_feed_info(tr::now), [=] {
|
||||
// controller->showSection(std::make_unique<Info::Memento>(
|
||||
// controller->showSection(std::make_shared<Info::Memento>(
|
||||
// feed,
|
||||
// Info::Section(Info::Section::Type::Profile)));
|
||||
// });
|
||||
|
@@ -253,12 +253,12 @@ void SessionNavigation::showRepliesForMessage(
|
||||
const auto channelId = history->channelId();
|
||||
//const auto item = _session->data().message(channelId, rootId);
|
||||
//if (!commentId && (!item || !item->repliesAreComments())) {
|
||||
// showSection(std::make_unique<HistoryView::RepliesMemento>(history, rootId));
|
||||
// showSection(std::make_shared<HistoryView::RepliesMemento>(history, rootId));
|
||||
// return;
|
||||
//} else if (const auto id = item ? item->commentsItemId() : FullMsgId()) {
|
||||
// if (const auto commentsItem = _session->data().message(id)) {
|
||||
// showSection(
|
||||
// std::make_unique<HistoryView::RepliesMemento>(commentsItem));
|
||||
// std::make_shared<HistoryView::RepliesMemento>(commentsItem));
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
@@ -314,7 +314,7 @@ void SessionNavigation::showRepliesForMessage(
|
||||
post->setRepliesOutboxReadTill(readTill->v);
|
||||
}
|
||||
}
|
||||
showSection(std::make_unique<HistoryView::RepliesMemento>(
|
||||
showSection(std::make_shared<HistoryView::RepliesMemento>(
|
||||
item,
|
||||
commentId));
|
||||
}
|
||||
@@ -342,7 +342,7 @@ void SessionNavigation::showPeerInfo(
|
||||
// Core::App().settings().setThirdSectionInfoEnabled(true);
|
||||
// Core::App().saveSettingsDelayed();
|
||||
//}
|
||||
showSection(std::make_unique<Info::Memento>(peer), params);
|
||||
showSection(std::make_shared<Info::Memento>(peer), params);
|
||||
}
|
||||
|
||||
void SessionNavigation::showPeerInfo(
|
||||
@@ -375,7 +375,7 @@ void SessionNavigation::showSettings(
|
||||
Settings::Type type,
|
||||
const SectionShow ¶ms) {
|
||||
showSection(
|
||||
std::make_unique<Info::Memento>(
|
||||
std::make_shared<Info::Memento>(
|
||||
Info::Settings::Tag{ _session->user() },
|
||||
Info::Section(type)),
|
||||
params);
|
||||
@@ -389,7 +389,7 @@ void SessionNavigation::showPollResults(
|
||||
not_null<PollData*> poll,
|
||||
FullMsgId contextId,
|
||||
const SectionShow ¶ms) {
|
||||
showSection(std::make_unique<Info::Memento>(poll, contextId), params);
|
||||
showSection(std::make_shared<Info::Memento>(poll, contextId), params);
|
||||
}
|
||||
|
||||
SessionController::SessionController(
|
||||
@@ -640,9 +640,9 @@ bool SessionController::jumpToChatListEntry(Dialogs::RowDescriptor row) {
|
||||
return true;
|
||||
//} else if (const auto feed = row.key.feed()) { // #feed
|
||||
// if (const auto item = session().data().message(row.fullId)) {
|
||||
// showSection(std::make_unique<HistoryFeed::Memento>(feed, item->position()));
|
||||
// showSection(std::make_shared<HistoryFeed::Memento>(feed, item->position()));
|
||||
// } else {
|
||||
// showSection(std::make_unique<HistoryFeed::Memento>(feed));
|
||||
// showSection(std::make_shared<HistoryFeed::Memento>(feed));
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
@@ -1087,7 +1087,7 @@ void SessionController::showPeerHistory(
|
||||
}
|
||||
|
||||
void SessionController::showSection(
|
||||
std::unique_ptr<SectionMemento> &&memento,
|
||||
std::shared_ptr<SectionMemento> memento,
|
||||
const SectionShow ¶ms) {
|
||||
if (!params.thirdColumn && widget()->showSectionInExistingLayer(
|
||||
memento.get(),
|
||||
|
@@ -132,7 +132,7 @@ public:
|
||||
Main::Session &session() const;
|
||||
|
||||
virtual void showSection(
|
||||
std::unique_ptr<SectionMemento> &&memento,
|
||||
std::shared_ptr<SectionMemento> memento,
|
||||
const SectionShow ¶ms = SectionShow()) = 0;
|
||||
virtual void showBackFromStack(
|
||||
const SectionShow ¶ms = SectionShow()) = 0;
|
||||
@@ -301,7 +301,7 @@ public:
|
||||
bool confirmedLeaveOther = false);
|
||||
|
||||
void showSection(
|
||||
std::unique_ptr<SectionMemento> &&memento,
|
||||
std::shared_ptr<SectionMemento> memento,
|
||||
const SectionShow ¶ms = SectionShow()) override;
|
||||
void showBackFromStack(
|
||||
const SectionShow ¶ms = SectionShow()) override;
|
||||
|
Reference in New Issue
Block a user