| 77 | } |
| 78 | |
| 79 | void rebuildTree(CurveTreeView* tree_view, CatalogModel* catalog, const QSet<QString>& custom_keys) { |
| 80 | tree_view->clearCurves(); |
| 81 | // Note: custom_view is NOT cleared here — custom series are managed separately |
| 82 | // via addCustomCurve/removeCustomCurve in MainWindow. |
| 83 | if (catalog == nullptr) { |
| 84 | return; |
| 85 | } |
| 86 | // Exclude keys routed to the Custom Series panel so they never appear in both. |
| 87 | std::vector<CatalogItem> tree_items; |
| 88 | for (const auto& item : catalog->items()) { |
| 89 | if (!custom_keys.contains(item.key)) { |
| 90 | tree_items.push_back(item); |
| 91 | } |
| 92 | } |
| 93 | addCatalogItems(tree_view, tree_items); |
| 94 | } |
| 95 | |
| 96 | } // namespace |
| 97 |
no test coverage detected