From aa7f2fcb1c8b7ada602a5a5dd64401cc11d4c189 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 14 Feb 2004 02:51:30 +0000 Subject: break devices loop into two pass: - first detect devices into each class - then process them for later display --- perl-install/standalone/harddrake2 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl-install/standalone/harddrake2') diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index a825c1a78..a04a647e6 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -233,6 +233,8 @@ $tree->get_selection->signal_connect('changed' => sub { my $index = 0; +my @classes; + # Fill the graphic devices tree with a "tree branch" widget per device category foreach (@harddrake::data::tree) { my ($Ident, $title, $icon, $configurator, $detector) = @$_; @@ -244,6 +246,12 @@ foreach (@harddrake::data::tree) { my @devices = &$detector; next unless @devices; # Skip empty class (no devices) + push @classes, [ $Ident, $title, $icon, $configurator, @devices ]; +} + +# Fill the graphic devices tree with a "tree branch" widget per device category +foreach (@classes) { + my ($Ident, $title, $icon, $configurator, @devices) = @$_; my $parent_iter = $tree_model->append_set(undef, [ 0 => gtkcreate_pixbuf($icon), 1 => $title, 2 => -1 ]); -- cgit v1.2.1