Make LimitedQueueSnapshot usages in ChannelView const (#4223)

This commit is contained in:
pajlada
2022-12-07 20:40:15 +01:00
committed by GitHub
parent 9f008f86d2
commit 4fdcac8ec5
2 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -426,7 +426,7 @@ void ChannelView::performLayout(bool causedByScrollbar)
// BenchmarkGuard benchmark("layout");
/// Get messages and check if there are at least 1
auto &messages = this->getMessagesSnapshot();
const auto &messages = this->getMessagesSnapshot();
this->showingLatestMessages_ =
this->scrollBar_->isAtBottom() ||
@@ -444,7 +444,7 @@ void ChannelView::performLayout(bool causedByScrollbar)
}
void ChannelView::layoutVisibleMessages(
LimitedQueueSnapshot<MessageLayoutPtr> &messages)
const LimitedQueueSnapshot<MessageLayoutPtr> &messages)
{
const auto start = size_t(this->scrollBar_->getCurrentValue());
const auto layoutWidth = this->getLayoutWidth();
@@ -468,11 +468,14 @@ void ChannelView::layoutVisibleMessages(
}
if (redrawRequired)
{
this->queueUpdate();
}
}
void ChannelView::updateScrollbar(
LimitedQueueSnapshot<MessageLayoutPtr> &messages, bool causedByScrollbar)
const LimitedQueueSnapshot<MessageLayoutPtr> &messages,
bool causedByScrollbar)
{
if (messages.size() == 0)
{