fix suggestions

This commit is contained in:
unknown 2024-10-15 01:08:02 +02:00 committed by hemirt
parent f7dd6de872
commit e827097c1c
3 changed files with 7 additions and 12 deletions

View file

@ -385,7 +385,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
void NotebookTab::setHighlightState(HighlightState newHighlightStyle, void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
ChannelView &channelViewSource, ChannelView &channelViewSource,
MessagePtr message) const MessagePtr &message)
{ {
if (this->isSelected()) if (this->isSelected())
{ {
@ -404,7 +404,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
return; return;
} }
auto splitContainer = auto *splitContainer =
dynamic_cast<SplitContainer *>(this->notebook_->getSelectedPage()); dynamic_cast<SplitContainer *>(this->notebook_->getSelectedPage());
if (splitContainer != nullptr) if (splitContainer != nullptr)
{ {
@ -419,14 +419,9 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
QSet(filterIdsSplit.cbegin(), filterIdsSplit.cend()); QSet(filterIdsSplit.cbegin(), filterIdsSplit.cend());
auto isSubset = []<typename T>(QSet<T> sub, QSet<T> super) { auto isSubset = []<typename T>(QSet<T> sub, QSet<T> super) {
for (auto &&subItem : sub) return std::ranges::none_of(sub, [&super](const auto &subItem) {
{ return !super.contains(subItem);
if (!super.contains(subItem)) });
{
return false;
}
}
return true;
}; };
if (channelViewSource.underlyingChannel() == split->getChannel() && if (channelViewSource.underlyingChannel() == split->getChannel() &&

View file

@ -62,7 +62,7 @@ public:
void setHighlightState(HighlightState style); void setHighlightState(HighlightState style);
void setHighlightState(HighlightState style, ChannelView &channelViewSource, void setHighlightState(HighlightState style, ChannelView &channelViewSource,
MessagePtr message); const MessagePtr &message);
HighlightState highlightState() const; HighlightState highlightState() const;
void setHighlightsEnabled(const bool &newVal); void setHighlightsEnabled(const bool &newVal);

View file

@ -219,7 +219,7 @@ void SplitContainer::addSplit(Split *split)
if (this->tab_ != nullptr) if (this->tab_ != nullptr)
{ {
this->tab_->setHighlightState( this->tab_->setHighlightState(
state, channelView, message); state, channelView, std::move(message));
} }
}); });