mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Make LimitedQueueSnapshot usages in ChannelView const (#4223)
This commit is contained in:
parent
9f008f86d2
commit
4fdcac8ec5
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue