From: Joel Holdsworth Date: Sun, 16 Aug 2015 15:22:08 +0000 (-0600) Subject: Header: Use list_by_type in on_ungroup X-Git-Tag: pulseview-0.3.0~93 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=698568bc567743a833a6a20489566c9b2b213190;p=pulseview.git Header: Use list_by_type in on_ungroup --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 60d64b2f..be4cebcb 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -198,15 +198,14 @@ void Header::on_ungroup() bool restart; do { restart = false; - for (const shared_ptr r : view_) { - const shared_ptr tg = - dynamic_pointer_cast(r); - if (tg && tg->selected()) { + const vector< shared_ptr > groups( + view_.list_by_type()); + for (const shared_ptr tg : groups) + if (tg->selected()) { tg->ungroup(); restart = true; break; } - } } while (restart); }