aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/gui.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-20 10:23:21 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-20 10:23:21 +0000
commit90f2c1525e18a3cdd522614bef6153f88e44988c (patch)
treefbc63dfaf17ba75c757fb39c9dde0abc289404c6 /Rpmdrake/gui.pm
parent2b2f9512fba3d23cbae2fa55ed1606664b36f527 (diff)
downloadrpmdrake-90f2c1525e18a3cdd522614bef6153f88e44988c.tar
rpmdrake-90f2c1525e18a3cdd522614bef6153f88e44988c.tar.gz
rpmdrake-90f2c1525e18a3cdd522614bef6153f88e44988c.tar.bz2
rpmdrake-90f2c1525e18a3cdd522614bef6153f88e44988c.tar.xz
rpmdrake-90f2c1525e18a3cdd522614bef6153f88e44988c.zip
(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?
Diffstat (limited to 'Rpmdrake/gui.pm')
-rw-r--r--Rpmdrake/gui.pm5
1 files changed, 3 insertions, 2 deletions
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));
+ }
}
}