| 735 | } |
| 736 | |
| 737 | void CatalogModel::removeItems(const std::vector<QString>& keys) { |
| 738 | // Accepts any catalog item kind. Object-topic keys are honored too, so the |
| 739 | // trash/remove flow stays symmetric across scalar fields and object topics |
| 740 | // — rebuildFromDatastore consults the same blacklist for both, so an entry |
| 741 | // removed here will not silently come back on the next commit. |
| 742 | QStringList removed; |
| 743 | for (const QString& key : keys) { |
| 744 | const auto it = impl_->items.find(key); |
| 745 | if (it == impl_->items.end()) { |
| 746 | continue; |
| 747 | } |
| 748 | const DatasetId dataset_id = it->second.dataset_id; |
| 749 | impl_->removed_names_per_dataset[dataset_id].insert(key); |
| 750 | impl_->items.erase(it); |
| 751 | removed.push_back(key); |
| 752 | } |
| 753 | if (!removed.isEmpty()) { |
| 754 | emit itemsRemoved(removed); |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | void CatalogModel::removeCurves(const std::vector<QString>& keys) { |
| 759 | removeItems(keys); |