Make LimitedQueueSnapshot usages in ChannelView const (#4223)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -195,8 +195,8 @@ private:
|
||||
|
||||
void performLayout(bool causedByScrollbar = false);
|
||||
void layoutVisibleMessages(
|
||||
LimitedQueueSnapshot<MessageLayoutPtr> &messages);
|
||||
void updateScrollbar(LimitedQueueSnapshot<MessageLayoutPtr> &messages,
|
||||
const LimitedQueueSnapshot<MessageLayoutPtr> &messages);
|
||||
void updateScrollbar(const LimitedQueueSnapshot<MessageLayoutPtr> &messages,
|
||||
bool causedByScrollbar);
|
||||
|
||||
void drawMessages(QPainter &painter);
|
||||
|
||||
Reference in New Issue
Block a user