Skip to content

Commit

Permalink
fix suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
hemirt committed Oct 14, 2024
1 parent e0da76c commit b8c8961
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
15 changes: 5 additions & 10 deletions src/widgets/helper/NotebookTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)

void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
ChannelView &channelViewSource,
MessagePtr message)
const MessagePtr &message)
{
if (this->isSelected())
{
Expand All @@ -404,7 +404,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
return;
}

auto splitContainer =
auto *splitContainer =
dynamic_cast<SplitContainer *>(this->notebook_->getSelectedPage());
if (splitContainer != nullptr)
{
Expand All @@ -419,14 +419,9 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
QSet(filterIdsSplit.cbegin(), filterIdsSplit.cend());

auto isSubset = []<typename T>(QSet<T> sub, QSet<T> super) {
for (auto &&subItem : sub)
{
if (!super.contains(subItem))
{
return false;
}
}
return true;
return std::ranges::none_of(sub, [&super](const auto &subItem) {
return !super.contains(subItem);
});
};

if (channelViewSource.underlyingChannel() == split->getChannel() &&
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/helper/NotebookTab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class NotebookTab : public Button

void setHighlightState(HighlightState style);
void setHighlightState(HighlightState style, ChannelView &channelViewSource,
MessagePtr message);
const MessagePtr &message);
HighlightState highlightState() const;

void setHighlightsEnabled(const bool &newVal);
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/splits/SplitContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void SplitContainer::addSplit(Split *split)
if (this->tab_ != nullptr)
{
this->tab_->setHighlightState(
state, channelView, message);
state, channelView, std::move(message));
}
});

Expand Down

0 comments on commit b8c8961

Please sign in to comment.