aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/gui.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-07-05 15:35:17 +0000
committerThierry Vignaud <tv@mandriva.org>2007-07-05 15:35:17 +0000
commitc03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732 (patch)
tree81b12d4d6429c70b0933e49c6b2e79f52d309927 /Rpmdrake/gui.pm
parentd3b70bccf3df57eb7185e30de0cdbac8f5eeaec5 (diff)
downloadrpmdrake-c03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732.tar
rpmdrake-c03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732.tar.gz
rpmdrake-c03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732.tar.bz2
rpmdrake-c03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732.tar.xz
rpmdrake-c03b88dad7a4a486fce6f6ebdfaf1c0c79a9e732.zip
(grep_unselected) make a function out of it
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r--Rpmdrake/gui.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 7892195f..e8b4143f 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -195,6 +195,8 @@ sub set_leaf_state {
set_node_state($_, $state, $model) foreach @{$ptree{$leaf}};
}
+sub grep_unselected { grep { exists $pkgs->{$_} && !$pkgs->{$_}{selected} } @_ }
+
sub add_parent {
my ($root, $state) = @_;
$root or return undef;
@@ -330,7 +332,7 @@ sub ask_browse_tree_given_widgets_for_rpmdrake {
my ($_val) = @_;
my @l = $children->() or return;
- my @unsel = $common->{grep_unselected}(@l);
+ my @unsel = grep_unselected(@l);
my @p = @unsel ?
#- not all is selected, select all if no option to potentially override
(exists $common->{partialsel_unsel} && $common->{partialsel_unsel}->(\@unsel, \@l) ? difference2(\@l, \@unsel) : @unsel)