From: Soeren Apel Date: Sun, 3 Apr 2016 19:15:00 +0000 (+0200) Subject: View: Remove empty trace groups in signals_changed() X-Git-Tag: pulseview-0.4.0~321 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bc72e51ffa24d47a382b118bfe63df154dac9cf1;p=pulseview.git View: Remove empty trace groups in signals_changed() --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index b7ee331f..758e7118 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -1083,6 +1083,11 @@ void View::signals_changed() owner->remove_child_item(trace); } + // Remove any empty trace groups + for (shared_ptr group : list_by_type()) + 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