]> sigrok.org Git - pulseview.git/commitdiff
View: Remove empty trace groups in signals_changed()
authorSoeren Apel <redacted>
Sun, 3 Apr 2016 19:15:00 +0000 (21:15 +0200)
committerSoeren Apel <redacted>
Sun, 3 Apr 2016 19:15:00 +0000 (21:15 +0200)
pv/view/view.cpp

index b7ee331f165c175bdaaf1080561b2ae31650644e..758e7118d8e94f2cee90f8334774056b8decc2b2 100644 (file)
@@ -1083,6 +1083,11 @@ void View::signals_changed()
                owner->remove_child_item(trace);
        }
 
+       // Remove any empty trace groups
+       for (shared_ptr<TraceGroup> group : list_by_type<TraceGroup>())
+               if (group->child_items().size() == 0)
+                       remove_child_item(group);
+
        // Add and position the pending top levels items
        for (auto item : new_top_level_items) {
                // Position the item after the last item or at the top if there is none