name fixes

This commit is contained in:
unknown 2024-10-15 18:14:11 +02:00
parent 70f497d3bd
commit 7728f01916
2 changed files with 14 additions and 11 deletions

View file

@ -384,7 +384,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
} }
void NotebookTab::setHighlightState(HighlightState newHighlightStyle, void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
ChannelView &channelViewSource, const ChannelView &channelViewSource,
const MessagePtr &message) const MessagePtr &message)
{ {
if (this->isSelected()) if (this->isSelected())
@ -404,25 +404,27 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
return; return;
} }
auto *splitContainer = auto *visibleSplitContainer =
dynamic_cast<SplitContainer *>(this->notebook_->getSelectedPage()); dynamic_cast<SplitContainer *>(this->notebook_->getSelectedPage());
if (splitContainer != nullptr) if (visibleSplitContainer != nullptr)
{ {
const auto &splits = splitContainer->getSplits(); const auto &visibleSplits = visibleSplitContainer->getSplits();
for (const auto &split : splits) for (const auto &visibleSplit : visibleSplits)
{ {
auto filterIdsSource = channelViewSource.getFilterIds(); auto filterIdsSource = channelViewSource.getFilterIds();
auto filterIdsSplit = split->getChannelView().getFilterIds(); auto filterIdsSplit = visibleSplit->getChannelView().getFilterIds();
auto isSubset = []<typename T>(const QList<T> &sub, const QList<T> &super) { auto isSubset = []<typename T>(const QList<T> &sub,
const QList<T> &super) {
return std::ranges::all_of(sub, [&super](const auto &subItem) { return std::ranges::all_of(sub, [&super](const auto &subItem) {
return super.contains(subItem); return super.contains(subItem);
}); });
}; };
if (channelViewSource.underlyingChannel() == split->getChannel() && if (channelViewSource.underlyingChannel() ==
split->getChannelView().shouldIncludeMessage(message) && visibleSplit->getChannel() &&
isSubset(uniqueFilterIdsSource, uniqueFilterIdsSplit)) visibleSplit->getChannelView().shouldIncludeMessage(message) &&
isSubset(filterIdsSource, filterIdsSplit))
{ {
return; return;
} }

View file

@ -61,7 +61,8 @@ public:
bool isLive() const; bool isLive() const;
void setHighlightState(HighlightState style); void setHighlightState(HighlightState style);
void setHighlightState(HighlightState style, ChannelView &channelViewSource, void setHighlightState(HighlightState style,
const ChannelView &channelViewSource,
const MessagePtr &message); const MessagePtr &message);
HighlightState highlightState() const; HighlightState highlightState() const;