| 608 | } |
| 609 | |
| 610 | QList<CFavoriteModel::tree*> CFavoriteModel::tree::FindRecursive(const CFavoriteDatabase::Item &item) const |
| 611 | { |
| 612 | QList<tree*> lstChildren; |
| 613 | if (item.id == this->item.id && item.type == this->item.type) { |
| 614 | lstChildren << const_cast<tree*>(this); |
| 615 | return lstChildren; |
| 616 | } |
| 617 | for (auto child : children) { |
| 618 | QList<tree*> found = child->FindRecursive(item); |
| 619 | if (!found.isEmpty()) { |
| 620 | lstChildren << found; |
| 621 | } |
| 622 | } |
| 623 | return lstChildren; |
| 624 | } |