aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-26 11:23:25 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-26 11:23:25 +0000
commit552d506a82618d8145ff8c284d60112349a4d3ba (patch)
treea05c1358adefe4972154330b50535550f8ee7656 /Rpmdrake
parent1974c4c1487c20a28e6631a8002659aba15fc5e6 (diff)
downloadrpmdrake-552d506a82618d8145ff8c284d60112349a4d3ba.tar
rpmdrake-552d506a82618d8145ff8c284d60112349a4d3ba.tar.gz
rpmdrake-552d506a82618d8145ff8c284d60112349a4d3ba.tar.bz2
rpmdrake-552d506a82618d8145ff8c284d60112349a4d3ba.tar.xz
rpmdrake-552d506a82618d8145ff8c284d60112349a4d3ba.zip
(set_node_state) set_node_state_tree() is now basically a wrapper
around set_node_state_flat(), doing the same checks; just merge them into their unique caller
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/gui.pm18
1 files changed, 3 insertions, 15 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index d56a2a42..aef6170f 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -177,28 +177,16 @@ sub node_state {
my ($common, $w, %wtree, %ptree, %pix);
-sub set_node_state_flat {
+sub set_node_state {
my ($iter, $state, $model) = @_;
- $state eq 'XXX' and return;
- $pix{$state} ||= gtkcreate_pixbuf($state);
+ ($state eq 'XXX' || !$state) and return;
+ $pix{$state} ||= gtkcreate_pixbuf('state_' . $state);
$model ||= $w->{tree_model};
$model->set($iter, $pkg_columns{state_icon} => $pix{$state});
$model->set($iter, $pkg_columns{state} => $state);
$model->set($iter, $pkg_columns{selected} => to_bool(member($state, qw(base installed to_install)))); #$pkg->{selected}));
}
-sub set_node_state_tree {
- my ($iter, $state, $model) = @_;
- $model ||= $w->{tree_model};
- ($state eq 'XXX' || !$state) and return;
- $pix{$state} ||= gtkcreate_pixbuf('state_' . $state);
- set_node_state_flat($iter, $state, $model);
-}
-
-sub set_node_state {
- $common->{state}{flat} ? set_node_state_flat(@_) : \&set_node_state_tree(@_);
-}
-
sub set_leaf_state {
my ($leaf, $state, $model) = @_;
set_node_state($_, $state, $model) foreach @{$ptree{$leaf}};