From 90f2c1525e18a3cdd522614bef6153f88e44988c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 20 Sep 2007 10:23:21 +0000 Subject: (toggle_nodes) fix counting size of selected package (#32506); maybe should we stop maintaining this counter and just reuse URPM::selected_size() if not too costly? --- Rpmdrake/gui.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 1acd0fa3..1d8cca6e 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -636,8 +636,9 @@ sub toggle_nodes { $pkgs->{$_}{selected} = $new_state; } $set_state->($_, node_state($_), $model); - $pkgs->{$_}{pkg} - and $size_selected += $pkgs->{$_}{pkg}->size * ($new_state ? 1 : -1); + if (my $pkg = $pkgs->{$_}{pkg}) { + $size_selected += $pkg->size * ($pkg->flag_installed ? ($new_state ? -1 : 1) : ($new_state ? 1 : -1)); + } } } -- cgit v1.2.1