| 686 | } |
| 687 | |
| 688 | void CatalogModel::clearAll(bool tombstone) { |
| 689 | if (impl_->items.empty()) { |
| 690 | return; |
| 691 | } |
| 692 | // Tombstone only when the underlying engine data is NOT being erased: the tombstone |
| 693 | // hides data that lingers in the engine. A real "delete all" erases the engine too, |
| 694 | // so there is nothing to hide (tombstone=false) and no soft-delete state accumulates. |
| 695 | if (tombstone) { |
| 696 | for (const auto& kv : impl_->items) { |
| 697 | impl_->removed_datasets.insert(kv.second.dataset_id); |
| 698 | } |
| 699 | } |
| 700 | impl_->items.clear(); |
| 701 | impl_->removed_names_per_dataset.clear(); |
| 702 | emit cleared(); |
| 703 | } |
| 704 | |
| 705 | void CatalogModel::resetRemovalState() { |
| 706 | if (impl_->removed_datasets.empty() && impl_->removed_names_per_dataset.empty()) { |