From 44fe395fd1fcec7bd2a31f8fdbbf2a3c57f45656 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 21 Feb 2005 20:13:31 +0000 Subject: uggly workaround of Gtk2::SimpleList bugs --- perl-install/standalone/drakids | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakids b/perl-install/standalone/drakids index e47f97ec7..48c893ae2 100644 --- a/perl-install/standalone/drakids +++ b/perl-install/standalone/drakids @@ -103,6 +103,13 @@ sub handle_init { init_lists(); } +sub list_remove_addr { + my ($list, @addr) = @_; + foreach (0 .. $#{$list}) { + member($list->[$_][0], @addr) and splice @$list, $_, 1; + } +} + sub init_blacklist { my @packets = $activefw->get_blacklist; while (my @blacklist = splice(@packets, 0, 8)) { @@ -139,7 +146,7 @@ sub unblacklist { my @addr = @_; $activefw->unblacklist($_) foreach @addr; #- delete from the list even if the above calls were unsuccessful - @{$blacklist->{data}} = grep { !member($_->[0], @addr) } @{$blacklist->{data}}; + list_remove_addr($blacklist->{data}, @addr); } sub init_whitelist { @@ -169,7 +176,7 @@ sub unwhitelist { my @addr = @_; $activefw->unwhitelist($_) foreach @addr; #- delete from the list even if the above calls were unsuccessful - @{$whitelist->{data}} = grep { !member($_->[0], @addr) } @{$whitelist->{data}}; + list_remove_addr($whitelist->{data}, @addr); } sub init_lists { -- cgit v1.2.1