mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
add some asserts
This commit is contained in:
parent
39e0e00f2d
commit
1ca5d38ad5
|
@ -344,6 +344,9 @@ void NotebookTab::copyHighlightStateAndSourcesFrom(const NotebookTab *sourceTab)
|
|||
{
|
||||
if (this->isSelected())
|
||||
{
|
||||
assert(this->highlightSources_.highlightedSource.empty());
|
||||
assert(this->highlightSources_.newMessageSource.empty());
|
||||
assert(this->highlightState_ == HighlightState::None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -391,7 +394,6 @@ void NotebookTab::setSelected(bool value)
|
|||
}
|
||||
|
||||
this->highlightSources_.clear();
|
||||
|
||||
this->highlightState_ = HighlightState::None;
|
||||
|
||||
this->update();
|
||||
|
@ -453,9 +455,14 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
|
|||
{
|
||||
if (this->isSelected())
|
||||
{
|
||||
assert(this->highlightSources_.highlightedSource.empty());
|
||||
assert(this->highlightSources_.newMessageSource.empty());
|
||||
assert(this->highlightState_ == HighlightState::None);
|
||||
return;
|
||||
}
|
||||
|
||||
this->highlightSources_.clear();
|
||||
|
||||
if (!this->highlightEnabled_ &&
|
||||
newHighlightStyle == HighlightState::NewMessage)
|
||||
{
|
||||
|
@ -472,18 +479,15 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
|
|||
this->update();
|
||||
}
|
||||
|
||||
void NotebookTab::forceHighlightState(HighlightState newHighlightStyle)
|
||||
{
|
||||
this->highlightState_ = newHighlightStyle;
|
||||
this->update();
|
||||
}
|
||||
|
||||
void NotebookTab::updateHighlightState(HighlightState newHighlightStyle,
|
||||
const ChannelView &channelViewSource,
|
||||
const MessagePtr &message)
|
||||
{
|
||||
if (this->isSelected())
|
||||
{
|
||||
assert(this->highlightSources_.highlightedSource.empty());
|
||||
assert(this->highlightSources_.newMessageSource.empty());
|
||||
assert(this->highlightState_ == HighlightState::None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,17 +61,11 @@ public:
|
|||
bool isLive() const;
|
||||
|
||||
/**
|
||||
* @brief Sets the highlight state of this tab clearing out highlight sources
|
||||
* @brief Sets the highlight state of this tab clearing highlight sources
|
||||
*
|
||||
* Obeys the HighlightsEnabled setting and highlight states hierarchy
|
||||
*/
|
||||
void setHighlightState(HighlightState style);
|
||||
/**
|
||||
* @brief Forces the highlight state of this tab
|
||||
*
|
||||
* Does NOT obey the HighlightsEnabled setting and the highlight states hierarchy
|
||||
*/
|
||||
void forceHighlightState(HighlightState style);
|
||||
/**
|
||||
* @brief Updates the highlight state and highlight sources of this tab
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue