Fix logic error when trying to find hovered item
Was just comparing this item's and the parent item's names. But if an item has no parents, only its own name has to match for the check to return true. Make sure that the number of parents also matches.
This commit is contained in:
parent
bbfa6a92cf
commit
8a6f224e26
|
@ -439,6 +439,9 @@ bool AbstractTreeViewItem::matches_including_parents(const AbstractTreeViewItem
|
|||
if (!matches(other)) {
|
||||
return false;
|
||||
}
|
||||
if (count_parents() != other.count_parents()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (AbstractTreeViewItem *parent = parent_, *other_parent = other.parent_;
|
||||
parent && other_parent;
|
||||
|
|
Loading…
Reference in New Issue