aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-03-20 12:59:20 +0000
committerThierry Vignaud <tv@mandriva.org>2008-03-20 12:59:20 +0000
commit3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c (patch)
tree7a9eb7c8cb33272cb387d9861b3c93fea6d56c82
parent06761378822b53d9248ff2270461231fc8f383cc (diff)
downloadrpmdrake-3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c.tar
rpmdrake-3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c.tar.gz
rpmdrake-3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c.tar.bz2
rpmdrake-3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c.tar.xz
rpmdrake-3577d8ff7d5b23cff0dd7d9fc385dafd65a6d51c.zip
(_build_tree) split it out of build_tree() (needed for next commits)
-rw-r--r--Rpmdrake/gui.pm24
1 files changed, 15 insertions, 9 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 5ce4ce28..7bafd9e3 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -805,6 +805,20 @@ sub ctreefy {
join('|', map { translate($_) } split m|/|, $_[0]);
}
+sub _build_tree {
+ my ($elems, @elems) = @_;
+ #- we populate all the groups tree at first
+ %$elems = ();
+ # better loop on packages, create groups tree and push packages in the proper place:
+ foreach my $pkg (@elems) {
+ my $grp = $pkg->[1];
+ add_parent($grp);
+ $elems->{$grp} ||= [];
+ push @{$elems->{$grp}}, $pkg;
+ }
+}
+
+
sub build_tree {
my ($tree, $tree_model, $elems, $options, $force_rebuild, $flat, $mode) = @_;
state $old_mode;
@@ -864,15 +878,7 @@ or you already installed all of them."));
? N("Upgradable") : N("Addable")
) foreach $sortmethods{flat}->(@elems);
} else {
- #- we populate all the groups tree at first
- %$elems = ();
- # better loop on packages, create groups tree and push packages in the proper place:
- foreach my $pkg (@elems) {
- my $grp = $pkg->[1];
- add_parent($grp);
- $elems->{$grp} ||= [];
- push @{$elems->{$grp}}, $pkg;
- }
+ _build_tree($elems, @elems);
}
}
statusbar_msg_remove($wait) if defined $wait;